I've just created a reasonably large DLL using classes, but have just realised I can't (or don't know how to) load the member functions using GetProcAddress() in the program to use the DLL.
I'll try and explain better like this:
Now I've read over the function pointer tutorial site but it doesn't really help because the DLL and other program are separate projects so if I declare a function pointer like this:Code:// the DLL class MyClass { public: MyClass () {} ~MyClass () {} bool Func (int, int); }; // the DLL class def. bool MyClass::Func (int a, int b) { (a > b) ? return true : return false; } // the Other Program typedef (*DLL_Func) (int, int); int main () { DLL_Func Func; HMODULE hLib = LoadLibrary ("thedll.dll"); // omitted error checking... Func = (DLL_Func) GetProcAddress (hLib, "Func"); // more error checking and rest of program }
I get linker errors when it tried to find MyClass::Code:typedef (MyClass::*DLL_Func) (int, int);
This is a pretty deep problem compared to what I'm usually faced with and could really use some guru-esque advice![]()



LinkBack URL
About LinkBacks
) load the member functions using GetProcAddress() in the program to use the DLL.


