Accessing a DLL class
-
I have a DLL decalred as follows:
#ifdef DLLDIR_EX #define DLLDIR __declspec(dllexport) #else #define DLLDIR __declspec(dllimport) #endif extern "C" { int DLLDIR DLLFunc2(int); void DLLDIR DrawEllipse(CRect, CDC*); }; extern int DLLDIR DLLArg; class DLLDIR DLLClass { public: DLLClass(); ~DLLClass(); int Add(int, int); int Sub(int, int); int Identify(void); int Arg; };
I can access my DLL functions using**LoadLibrary**
andGetProcAddress
but how would I gain access to the DLL class using the same procedure? Thanks. -
I have a DLL decalred as follows:
#ifdef DLLDIR_EX #define DLLDIR __declspec(dllexport) #else #define DLLDIR __declspec(dllimport) #endif extern "C" { int DLLDIR DLLFunc2(int); void DLLDIR DrawEllipse(CRect, CDC*); }; extern int DLLDIR DLLArg; class DLLDIR DLLClass { public: DLLClass(); ~DLLClass(); int Add(int, int); int Sub(int, int); int Identify(void); int Arg; };
I can access my DLL functions using**LoadLibrary**
andGetProcAddress
but how would I gain access to the DLL class using the same procedure? Thanks.You can't. You need to use implicit linking if you want to import classes (that is, you need to link to the library which is associated with the dll and not using LoadLibrary).
Cédric Moonen Software developer
Charting control [Updated - v1.1]