在vs2010下写程序调一个API,结果返回的句柄始终为NULL,GetLastError() = 126。
说明LoadLibrary不成功,全部重新配置之后,Debug结果如下:
Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\shlwapi.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file
Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file
非常费解,在优快云论坛上查到解决办法:
原因是程序输出的地方是系统而不是vs2010
Ctrl + F5运行就可以了或者在cmd命令行下执行程序。
本文介绍了一种在Visual Studio 2010中遇到的问题,即调用API后返回的句柄始终为NULL且GetLastError()返回126。文章详细解释了错误原因,并给出了两种解决方案:通过Ctrl+F5运行程序或在命令提示符下执行。
5万+

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



