3
Contributors
14
Replies
16
Views
6 Years
Discussion Span
Last Post by Ancient Dragon
Featured Replies
0

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.

0

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 by ben25x: n/a

0

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.

0

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

0

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

0

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.

0

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

0

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 by Ancient Dragon: n/a

0

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 by ben25x: n/a

0

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.