-
February 9th, 2011, 08:32 AM
#1
Unmanaged host (exe) trying to load managed (dll) as a MFC extension
Hi
As the topic says:
Unmanaged host (exe) trying to load managed (dll) as a MFC extension.
Is it possible?
The main host (exe) is not compiled with the /clr and I've just added a MFC Extension DLL that is managed and I followed the tips here: http://msdn.microsoft.com/en-us/library/x0w2664k.aspx
The header is:
class AFX_EXT_API CWPFContainer : public CWnd
but I get errors on the internal:
2>DlgTemplate.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall CWPFContainer::CWPFContainer(void)" (__imp_??0CWPFContainer@@QAE@XZ) referenced in function "public: virtual void __thiscall CDlgTemplate::AddItem(class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > >,class CRect,class CStringArray &,class CStringArray &,class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > >)" (?AddItem@CDlgTemplate@@UAEXV?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@VCRect@@AAVCStringArray@@20@Z)
2>DlgTemplate.obj : error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall CWPFContainer::GetRuntimeClass(void)const " (?GetRuntimeClass@CWPFContainer@@UBEPAUCRuntimeClass@@XZ)
2>DlgTemplate.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_MSGMAP const * __thiscall CWPFContainer::GetMessageMap(void)const " (?GetMessageMap@CWPFContainer@@MBEPBUAFX_MSGMAP@@XZ)
2>DlgTemplate.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CWPFContainer::~CWPFContainer(void)" (__imp_??1CWPFContainer@@UAE@XZ) referenced in function "public: virtual void * __thiscall CWPFContainer::`scalar deleting destructor'(unsigned int)" (??_GCWPFContainer@@UAEPAXI@Z)
-
February 9th, 2011, 08:38 AM
#2
Re: Unmanaged host (exe) trying to load managed (dll) as a MFC extension
Well it is not the runtime errors, it is just Link errors.
Did you add the .lib file for your class CWPFContainer into the list of libraries/oject files?
Victor Nijegorodov
-
February 9th, 2011, 04:46 PM
#3
Re: Unmanaged host (exe) trying to load managed (dll) as a MFC extension
That was a rookie mistake
Thank you VictorN, been a while with C++, hehe
Found a great example here btw: http://devonethatdevelops.wordpress....th-hwndsource/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|