Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interfacing C DLL with Fox.
Message
From
22/09/1998 08:55:56
 
 
To
21/09/1998 13:09:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00139024
Message ID:
00139440
Views:
28
>>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.

Why thank you! That helps and explains a lot. I've seen the 'extern "C"' before, but always though that the compiler would understand that I was trying to write C. I was wrong. :-)
Alexandre Nobre
Alpha Bytes Computer Corp.

Did you know that there are innocent people dying in East Timor?
It helps if you do...

I suppose you don't need glasses if you're able to read this line

Previous
Reply
Map
View

Click here to load this message in the networking platform