Thank you very much. It works now.
Bisyork
Posts
-
Calling classes from DLLs -
Calling classes from DLLsSomefunc is in the EXE.
///EXE code
class CDervDlg : public CDialog
{
void TestLoad();
void SomeFunc(CString, CString);BOOL m\_SomeVar;
};
typedef int (*SCGptr)(CDervDlg *);
void TestLoad()
{
HINSTANCE inst = AfxLoadLibrary("testlib.dll");
SCGptr Startfunc = (SCGptr)GetProcAddress(inst, "?Start@@YAHPAVCDervDlg@@@Z");
if (Startfunc != NULL)
Startfunc(this);
}///DLL code
#include "DervDlg.h"__declspec(dllexport) int Start(CDervDlg *dlg)
{
dlg->m_SomeVar = TRUE; //Works fine
dlg->SomeFunc("Blah", "Blah"); //Link error: unresolved external symbol.
}Thank you for helping.
-
Calling classes from DLLsI have been having problems trying to set up a plugin for my program. The program loads a DLL dynamically, and then calls a member function:
__declspec(dllexport) int Start(CDervDlg *dlg)
{
dlg->m_SomeVar = TRUE; //Works fine
dlg->SomeFunc("Blah", "Blah"); //Link error: unresolved external symbol.
}I've tried using both regular DLLs and Extension DLLs, but neither work. This is probably just something obvious that I just can't see, but can anyone help?