AnsweredAssumed Answered

Vrf - DLLs :)

Question asked by VRFuser on Apr 5, 1999
Latest reply on Apr 5, 1999 by VRFuser
Jest fer fun:

> For some peticular reason you have to compile your dll for use by External
> "C" functions if you use cpp compiler. Secondly, whether C or C++ you have

Yes indeedy. Without going into a lot of detail, C++ allows class member
functions to have the same name. The compiler differentiates them by their
parameter list order and type. The compiler generates the proper information
for the linker, and the end result is that you and me really don't care.
When dynamically linking however, this information must be preserved somehow
and yup, name mangling is the answer. There are many mangling schemes, but
usually the name is based on the number and type of parameters to that
function. Without the 'extern "C"' declaration modifier, something like
MyClass::MyFunc(int index, double time) winds up being called something like
MyFunc@@2ID as far as the compiler is concerned. Wich, incedentally, can be
used quite easily by VEE. You just have to get the name right.

> to place the _declspec(dllexport) in front of each function definition. If
> that was not done when your dll was compiled, then you won't see an export

Correct again. The "old way" was to use a .def file with an EXPORTS section.
The new way (for MS anyway) is to use their "declaration specifier" stuff
and say it's gonna be a dllexport.

Shawn Fessenden
Mgr., Technical Support
Oswego Software, Inc.