Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DLL Entry Point
Message
De
27/04/1999 16:49:50
 
Information générale
Forum:
Visual C++
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00212410
Message ID:
00212745
Vues:
26
This worked for me:

1. put this in the header of your DLL

#ifdef MYDLL_EXPORTS
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif

#ifdef __cplusplus
extern "C" {
#endif
MYDLL_API int fnMyDll(int num);
#ifdef __cplusplus
}
#endif

2. put this in the header of your calling program

#ifdef MYDLL_EXPORTS
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif

MYDLL_API int fnMyDll(int num);

MYDLL_EXPORTS is a compiler flag that gets set when you compile as a DLL.
Your function gets defined as an export within the DLL, but as an import within the calling program.

3. Then call the function normally.

int liRslt = fnMyDll(0);

Hope this helps,
Ken
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform