CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2000
    Location
    Langesund, Telemark in Norway!
    Posts
    292

    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)
    ==========================
    Lars Werner aka Large
    http://lars.werner.no/
    ==========================

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    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

  3. #3
    Join Date
    May 2000
    Location
    Langesund, Telemark in Norway!
    Posts
    292

    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/
    ==========================
    Lars Werner aka Large
    http://lars.werner.no/
    ==========================

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured