想使用GetModuleHandle来得到HMODULE却发现GetLastError总是显示“找不到指定的模块”。看了msdn才知道:GetModuleHandle只能得到已经加载到当前进程的内存中的Module,所以还是使用LoadLibrary吧
我错了~+_+
msdn上的相关说明:
The GetModuleHandle function retrieves a module handle for the specified module if the file has been mapped into the address space of the calling process.
The LoadLibrary function maps the specified executable module into the address space of the calling process.
本文探讨了GetModuleHandle与LoadLibrary两个Windows API函数的使用区别。GetModuleHandle仅能获取已加载到当前进程内存的模块句柄,而LoadLibrary则会将指定的可执行模块映射到调用进程的地址空间。
7252

被折叠的 条评论
为什么被折叠?



