LoadLibrary() error code 127

后端 未结 9 2251
無奈伤痛
無奈伤痛 2020-12-29 05:07

I\'m having trouble with LoadLibrary() and getting an error that doesn\'t make sense to me:

   ::SetLastError(0);

   m_hDll = ::LoadLibrary(szName);

   if          


        
9条回答
  •  甜味超标
    2020-12-29 06:06

    Ok, here is my solution: we had a complex dependency system and among them there were two DLLs with the same name (i.e. server.dll), but located on different paths.

    When client.dll was loaded with LOAD_WITH_ALTERED_SEARCH_PATH, it seems, that windows wasn't able to figure out which one of server.dll should be used in symbols resolution (both server.dll were successfully loaded, of course).

    The solution was quite easy: let the loaded dlls have unique names, i.e server-1.dll and server-2.dll.

提交回复
热议问题