Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DLL Entry Point
Message
From
27/04/1999 16:49:50
 
General information
Forum:
Visual C++
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00212410
Message ID:
00212745
Views:
27
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform