Export instance of class into dll
Posted on 1998-07-09
I want to export global variable that is instance of some class into dll. I have tried usual technique:
__declspec(dllexport) CMyClass MyInst; // declaration in .exe
__declspec(dllimport) CMyClass MyInst; // declaration in .dl
but I get link error (error LNK2001: unresolved external symbol "class CMyClass MyInst").
If I try do the same with simple type ( like int or void* ) it succedes. Is it possible to export
instance of class into dll and if it is - how?
Thanx for any help.
Platform: VC5/NT4 ( not using MFC )