Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interfacing C DLL with Fox.
Message
De
21/09/1998 13:09:51
 
 
À
21/09/1998 10:34:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00139024
Message ID:
00139106
Vues:
40
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform