Discussion Locked

Source code converting

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Hi all, I'm looking for a tool which is able to convert the C++ code into Visual Basic language... Is anyone know what are the option available for me? Thanks.....

5 replies

by guruofdos

C into VB doesn't go! Neither does VB into C too easily. VB uses OCX and DLL files to add additional features not present in native VB. VB cannot pass variables as memory pointers which C relies on. Data types for numerical data aren't identical...VB has no differentiation between signed and unsigned integers and has no 'byte' variable. I would suggest rather than translate th source code, start further back with the functional representation of the code (flow charts, algorithms and methodology) and re-write the program in the other language, top down, rather than recode from the bottom up! The re-coding isn't the problem...debugging it and making it function is!!

by jackofalltech

Although some of the things the previous poster said about VB were wrong, I don't understand why you would WANT to go from C to VB. While VB makes it ridiculously easy to create a Windows program, the trade-offs in terms of speed and size must be taken into consideration.

Ralph

by guruofdos

As a VB Programmer of 10 years experience who has often tried rewriting C code in VB....I think I know what I'm talking about!

by jackofalltech

Guru,

I wasn't disagreeing with your overall point, just a few of the details. "VB uses OCX and DLL files..." C can also use these. "VB cannot pass variables as memory pointers..." Not true!

I also don't want to get into a pissing contest with you but I've been programming for almost thirty years in various languages including Assembler, Pascal, C, VB (DOS and Windows) and several more on the mainframe.

I have a high regard for the opinions you express in these posts but no one is perfect, including myself.

Ralph

by guruofdos

What I meant to say is that VB MUST use DLL and OCX files to perform certain functions which are native to C. For example, I/O functions are not available in VB....at least not in any of the 5 versions I use! I write simulator software that has to access IO addresses (&H378 and &H379 for example to perform digital I/O via the printer port) and have to use additional DLL libraries to perform IO operations which are native to C. VB CANNOT pass pointers in all versions up to and including VB5! I'msorry, but it CAN'T!!! However, the VB runtime DLL libraries are there EXPLICITLY to perform that function. If you use Scanbin or a similar program to locate the calls in the runtime DLL's, you will find that all they do is perform the memory pointer to variable translation...VBRUN300.DLL for instance has just one function call (VarToPTR).

Of course, VB was never intended to be used by programmers wishing to access hardware. If you ever have a spare six months to spend, do an internet search to find source code for accessing the Windows volume controls and modifying or displaying their settings...you will find a few examples in C++. Try reprogramming them in VB!! Great in the days of ISA Soundblasters when all you had to do was read and write 8 bit IO registers in the ISA address space to st mic, CD and Aux levels (assuming of course you had an appropriate IO DLL!), but try doing it in VB with a PCI sound card!!

This discussion is closed to new replies.