I just created a DLL for my boss in MSVC++2010. I selected "New Win32 DLL" with option "Export symbols", so, everything is completely standard. There are some predefined exports in the new project files, a class, its constructor, a global function and variable with bogus values and a file dllmain.cpp with an APIENTRY function. I changed nothing yet.
Now my boss wants to use the exported things in his VB6 project. He started a VB6 project, did menu "Project" - "Links" (translated from German to English, so it might be somewhat different but I'm sure you know what I mean) and selected a DLL file, just as he says he usually does.
However, VB6 fails to include it, instead showing an error message "could not include DLL file" (no real reason given). The same occurred with a standard new DLL project from Visual C++ 6. My boss thinks it might be because the symbols are not really exported or VB6 needs some special declarations. Does anyone know what the problem is?
Yeah, VB6 doesn't work like that. You need to declare the DLL functions in your VB code somewhat like this:
You would replace "user32" with "MyCPlusPlusDLL.dll" and use the actual method names and signatures etc. from your DLL. Then put the DLL in your /System folder and you should be good to go.
Note: this is assuming that the methods inside your C++ DLL are declared with "__declspec".