使用下面的LoadLibraryEx可以成功
HMODULE hmod = LoadLibraryEx("C:\\MyDll.dll", NULL, DONT_RESOLVE_DLL_REFERENCES )
看了下MSDN:
DONT_RESOLVE_DLL_REFERENCES If this value is used, and the executable module is a DLL, the system does not call DllMain for process and thread initialization and termination. Also, the system does not load additional executable modules that are referenced by the specified module.
If this value is not used, and the executable module is a DLL, the system calls DllMain for process and thread initialization and termination. The system loads additional executable modules that are referenced by the specified module.
也就是说不会执行dll入口函数,LoadLibrary会在哪个环节出错呢?
边思考边等高手...