LoadLibrary失败的原因
来源:互联网 发布:mac idea groovy 配置 编辑:程序博客网 时间:2024/04/29 17:22
今天使用LoadLibrary时,失败,于是翻了一下MSDN:
LoadLibrary
The LoadLibrary function maps the specified executable module into the address space of the calling process.
For additional load options, use the LoadLibraryEx function.
HMODULE LoadLibrary(
LPCTSTR lpFileName // file name of module
);
Parameters
lpFileName
[in] Pointer to a null-terminated string that names the executable module (either a .dll or .exe file). The name specified is the file name of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition (.def) file.
If the string specifies a path but the file does not exist in the specified directory, the function fails. When specifying a path, be sure to use backslashes (\), not forward slashes (/).
If the string does not specify a path, the function uses a standard search strategy to find the file. See the Remarks for more information.
Return Values
If the function succeeds, the return value is a handle to the module.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Windows 95: If you are using LoadLibrary to load a module that contains a resource whose numeric identifier is greater than 0x7FFF, LoadLibrary fails. If you are attempting to load a 16-bit DLL directly from 32-bit code, LoadLibrary fails. If you are attempting to load a DLL whose subsystem version is greater than 4.0, LoadLibrary fails. If your DllMain function tries to call the Unicode version of a Win32 function, LoadLibrary fails.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
注意上面红色的文字,如果我们在dll的入口函数DllMain()中调用Unicode版本的系统API,则
LoadLibrary加载我们的dll文件时会失败,这就是我这次加载dll失败的原因,将API改为A版本的就
正常了,如GetModuleFileNameA
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
您的十分满意是我追求的宗旨。
您的一点建议是我后续的动力。
- Loadlibrary 失败的原因
- LoadLibrary失败的原因
- LoadLibrary 失败的一个原因
- LoadLibrary调用失败原因
- LoadLibrary调用失败原因
- Win32 LoadLibrary 失败的2种可能原因
- loadlibrary 失败的解决方法
- LoadLibrary失败
- LoadLibrary失败
- LoadLibrary失败
- LoadLibrary失败
- loadlibrary失败
- LoadLibrary加载动态库失败的解决办法
- LoadLibrary失败,getlasterror返回126的心得
- LoadLibrary加载动态库失败的解决办法
- LoadLibrary加载dll失败的问题
- 一次LoadLibrary调用失败的调试经历
- VS2010 Loadlibrary失败【解决】
- 小闹一下vb.net 正则表达式
- 二进制数操作
- Java高级特性(一)
- js 省市 二级联动
- 打通两台机器的ssh功能
- LoadLibrary失败的原因
- hdu 1528 二分匹配
- Java高级特性之static与final(一)
- C#泛型约束
- JZ2440 搭建NFS服务
- 深入理解linux网络技术内幕笔记
- C++中const保护数据的学习笔记
- 项目经理管理心得体会之一
- Java高级特性之clone方法(一)