Page 1 of 1

Need to find a C++ to Visual Basic Conversion Program...

Posted: Tue May 24, 2005 1:23 pm
by SirWinner
Need to convert some C++ code to Visual Basic 6 or VB.Net!

The client application has to be in VB if at all possible!

Anyone have any helpful links?

Please NO discussion on which programming language is better. Each has its' own strengths and weaknesses.

Thanks.

8)

Posted: Tue May 24, 2005 2:22 pm
by fliptw
Is the client going to maintain the code in VB? i'd just write a library wrapper for the code.

There are every expemsive VB to C++ converters. but no C++ to VB converters - probably because of all the ambiguities that C++ can create with code.

You might have to write some VB yourself.

Posted: Tue May 24, 2005 2:38 pm
by SirWinner
Let me clarify:

I have to maintain the code.

The application program has code already written in VB that is up and running.

Need to add functionality from some C++ stuff into this application but the way the C++ code is written it is not easily understood.

Don't have the time to rewrite the existing application program in C++.

Sounds like I'll have to hand code the C++ to VB conversion.

Thanks for the feedback.

:cry:

Posted: Tue May 24, 2005 4:47 pm
by fliptw
Can't you redo the C++ code as a library, and just call that code from VB?

Posted: Tue May 24, 2005 8:13 pm
by Grendel
Wrap the C++ code into an active X control and use that. I don't think there's such a thing like a C++ -> VB converter..

Posted: Tue May 24, 2005 9:10 pm
by DCrazy
Hopefully, the C++ code is just a bunch of functions. If so, just compile the project as a DLL instead of an application. Then you can use the LoadLibrary API to access the DLL from VB, and not have to mess with learning COM objects.

If you wind up having to use COM (ActiveX) to use your C++ code in VB, look up IDispatch in the MSDN docs.

Posted: Wed May 25, 2005 4:21 pm
by SirWinner
The calls I need to make are to DLL's but the code that makes those calls is in C++ with a lot of excess stuff that is C++ header file related (etc...) to get the programs to run when compiled.

Going to attempt to hand code it from C++ to VB.

Thanks for the input guys.

Did e-mail the company that has the SDK stuff... Their old stuff has VB and C++ example code but all their new stuff is in C++.
- Sounds like Microsoft and the new DirectX samples but this SDK was not done by Microsoft.

Going to see if anything in the OLD stuff will give hints on how to do the conversion!

I'd much rather imbed the code needed into ONE program than to have tons of baby applications in multiple programming languages.

:x

Posted: Wed May 25, 2005 9:28 pm
by DCrazy
If the excess stuff is C++ header file related, hopefully you won't *need* it in the VB implementation. If the DLL was written (and compiled) properly, you should be able to use LoadLibrary without a hitch.

Posted: Fri May 27, 2005 9:38 pm
by SirWinner
Plan B: Turned the project over to an old friend of mine out of my state since he does quite a bit of C programming.

Visual Studio 6 C++ project file had a lot of hidden files to go through. Never did find where it finds the link to the DLL... even though I knew the DLL's name.

8)

Posted: Wed Jun 01, 2005 5:18 pm
by DCrazy
Well, the thing is, if the linker establishes the links at design time, the code doesn't necessarily need to establish a connection to the DLL. Visual C++ can use the TLB (type library) file to determine where the DLL's exports are in the DLL file, and compile against the DLL without needing to call LoadLibrary. This is how VC++ links against the WinAPI; MS ships VC++ with .TLB files for every WinAPI library, and even though the actual code is called at runtime, the link is made at compile time.

You'll find references to .dll files in the Project Settings dialog box, IIRC.