LoadLibrary() error code 127

后端 未结 9 2189
無奈伤痛
無奈伤痛 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

    I would suggest using Dependency Walker to find out which method is missing or what DLLs are required or missing.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-29 06:11

    I was getting the same error code after calling LoadLibrary(). Finally found through dependency walker that some dependencies of module (szName) were missing.

    0 讨论(0)
提交回复
热议问题