
Calling Visual C++-dll from Visual Basic
Quote:
>> Try a def file which specify your library name and exported functions.
don't
>> use dllexport in function declaration of c++ source code.
>> hope this helps.
>I don't see how it helps ...
The point is that Visual C++ creates "decorated functions names" for the
exported functions. These are, as said in some other reply, an underscore
the function. Now, using the def file, the situation does not change for
Visual Basic, but for Visual C++. If you add the def file to the VC++
project (and set calling conventions to "standard calls") the compiler seems
to be clever enough to understand that I want to export my functions with
exactly the name I gave them in my source code. In other words: The compiler
(more precisely the linker) converts the decorated names into the proper
ones.
However, I agree that this must be some sort of joke. I've found this
solution on several web-pages now and it seems to be the only solution if
you really want to export the functions with "normal" names. I don't know if
def-files are really "depreciated" but it seems (...not really...) funny to
me that I have to introduce a def file in VC6 again, when I could do the
same thing in Borland C5 without the def for years.
As I still believe in Billy (...again: not really...), I'm still looking for
that undocumented switch in the Visual C GUI...
Joe