Hello everyone. I am looking to see if there is any possible way Visual Basic 6.0 code can run in Visual C++ 2008 Express. Any help would be very appreciated.

I don't even know how anyone could ask such a question. The answer is of course not. Visual Basic 4-6 made heavy use of COM and COM components. These components are usable from C++, but the components are binary objects - not code.

sorry, i said that totally wrong. basically what im trying to do is put code in the basic that references a .dll file created by the c++ code that has the actual stuff in it. how do you reference the .dll in basic?

Edited 5 Years Ago by ben25x: n/a

VB can access any dll written in C language, but C++ DLLs have to have special handling, such as the DLL either has to use extern "C" to make the DLL exported functions C style functions or the VB program has to know about name mangling, and you will have to do that manually. It depends on how the C++ dll was written and what compiler was used to generate the DLL. There is no standard way for compilers to mangle names.

Here are some threads you should review.

oh, did i specify that i was writing c code in the c++ compiler? sorry. its Visual C++ 2008 Express with C code.

and yeah, maybe i should've started this thread in the basic discussion. my bad.

Yes you can write C code with that compiler, providing you named the file *.c instead of *.cpp. If the file is named *.cpp then the compiler will treat it as C++, not C.

i know. what i'm asking is....how do you create a regular windows .dll instead of an .exe from that compiler?

i know. what i'm asking is....how do you create a regular windows .dll instead of an .exe from that compiler?

From which compiler? VC++ 2010 or VB? You can create DLLs from both of them.

In VC++ just create a DLL project and the IDE will generate all the basic code for you. I'm not sure about VB, probably something similar.

Edited 5 Years Ago by Ancient Dragon: n/a

ok, yeah, the dll is created from the C++ compiler and accessed by the VB code, now how do you access it from the VB code? looking for actual code here.

Edited 5 Years Ago by ben25x: n/a

i know i put it in the wrong thread area, but i'm new to vb, and don't know how to do that either.

This article has been dead for over six months. Start a new discussion instead.