CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2017
    Location
    Switzerland, Wallisellen
    Posts
    14

    can not loat C++Cli dll after migration from C86 to X64 error 0xc06d007e

    After the migration from X86 to X64 we cant load some C++/CLI Dlls anymore. The Project Setting a die not changed really and also the Source is allmost the same ( just some changes form int to __int64 how can i find out what is the exact Problem. Can i check the dll somehow to find out what is wrong with the Dll.



    In our Example the dll i can not load is the is the NmsModelTDotNet.dll

    when i debug i have the following call Stack

    KernelBase.dll!wil:etails:ebugBreak(void) Unknown
    clr.dll!MdaXmlMessage::SendDebugEvent(void) Unknown
    clr.dll!MdaXmlMessage::SendEvent(void) Unknown
    clr.dll!MdaXmlMessage::SendMessage(void) Unknown
    clr.dll!MdaXmlMessage::SendMessagef(int,...) Unknown
    clr.dll!MdaLoaderLock::ReportViolation(struct HINSTANCE__ *) Unknown
    clr.dll!CanRunManagedCodeRare() Unknown
    clr.dll!CorDllMainForThunk(struct HINSTANCE__ *,struct HINSTANCE__ *) Unknown
    mscoreei.dll!CorDllMainWorkerForThunk(struct HINSTANCE__ *) Unknown
    mscoreei.dll!VTableBootstrapThunkInitHelper() Unknown
    mscoreei.dll!VTableBootstrapThunkInitHelperStub() Unknown
    > NmsModelTDotNet.dll!ExtRawDllMain(HINSTANCE__ * __formal, unsigned long dwReason, void * __formal) Line 56 C++
    [External Code]
    NmsModApi.dll!__delayLoadHelper2(const ImgDelayDescr * pidd, __int64(*)() * ppfnIATEntry) Line 296 C++
    [External Code]
    NmsModApi.dll!APlatformObjects::LoadVendorInternal(const AEnumVendor & eVendor, const AString & sVersion) Line 10187 C++
    NmsModApi.dll!APlatformObjects::LoadVendor(const AEnumVendor & eVendor, const AString & sVersion) Line 10152 C++
    NmsModApi.dll!APlatformObjects::Initialize(bool bIsSos) Line 10066 C++
    Nms.exe!AApp::InitInstance() Line 675 C++
    [External Code]
    Nms.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 26 C++
    [External Code]

    the ExRawDllMain is the Default

    BOOL WINAPI ExtRawDllMain(HINSTANCE, DWORD dwReason, LPVOID)
    {
    if (dwReason == DLL_PROCESS_ATTACH)
    {
    // save critical data pointers before running the constructors
    AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
    pModuleState->m_pClassInit = pModuleState->m_classList;
    pModuleState->m_pFactoryInit = pModuleState->m_factoryList;
    pModuleState->m_classList.m_pHead = NULL;
    pModuleState->m_factoryList.m_pHead = NULL;
    }
    return TRUE; // ok
    }

    from MFC

    we do delay load this Dll. But when do not delay load th dlle i have the same problem. It happens just earlier. Whe i try to load the Dll with

    LoadLibrary(_T("NmsModelTDotNet.dll"));


    i have the same error

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: can not loat C++Cli dll after migration from C86 to X64 error 0xc06d007e

    What is the target (e.g. x86 or x64) of the:
    1) main application
    2) dll you are trying to load

    Are they both being compiled to the same target?

  3. #3
    Join Date
    Feb 2017
    Location
    Switzerland, Wallisellen
    Posts
    14

    Re: can not loat C++Cli dll after migration from C86 to X64 error 0xc06d007e

    Yes they are all X64

  4. #4
    Join Date
    Feb 2017
    Location
    Switzerland, Wallisellen
    Posts
    14

    Re: can not loat C++Cli dll after migration from C86 to X64 error 0xc06d007e

    Meanwhile i can load the library at lest the command LoadLibrary works but as soon as i want to use the Dll the first time there is an Error. The error occurs when i add ad dummy class



    class NMS_X64MODAPIDOTNET_EXPORT Test
    {
    public:
    Test();
    ~Test();

    };

    and the implementation does nothing


    Test::Test()
    {
    }


    Test::~Test()
    {
    }

    NMS_X64MODAPIDOTNET_EXPORT is _declspec (dllimport) fo the cunsumers and __declspec (dllexport)
    for the X64 dll

Tags for this Thread

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