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.

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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.

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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?

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

Is the C++ created dll just a plain vanella Windows dll, or is it a COM component housed in a dll?

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

just a Windows dll

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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.

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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.

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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.

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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.

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

The same way you access any of the Microsoft win32 api functions. This is c++ forum, not vb.

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

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.

Re: Compatibility: Visual Basic 6.0 and Visual C++ 2008 Express 80 80

Then you need to start reading tutorials on how to write VB code. Here is a list of a whole bunch of tutorials.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.