>Just one more thing... Using the usual "__declspec(dllexport)" didn't make the function visible. I had to put it in the .DEF file. If you have any idea why this is, I'd appreciate to know. But it's not that important. :-)
Visual C++ is a C++ compiler, not a C compiler. In order to implement OOP, C++ compilers do strange things to function names. This is often referred to as “name mangling.” You must explicitly tell the compiler to give a function a standard (API) style function name. This is how I do it:
extern "C" __declspec(dllexport) type function1();
extern "C" __declspec(dllexport) type function2();
or
extern "C" {
__declspec(dllexport) type function1();
__declspec(dllexport) type function2();
}
The
extern "C"
declaration seems to only be necessary for the function prototype.