Vusial Studio提示“Cannot find or open the PDB file”解决方法

来源:互联网 发布:男朋友不喜欢狗 知乎 编辑:程序博客网 时间:2024/05/20 17:07

刚刚学习C++API编程,要自己创建一个窗口程序,结果按了调试按钮没有出现预期的窗口,输出窗口提示如下:

......,已加载符号。
......,Cannot find or open the PDB file
......,Cannot find or open the PDB file
......,Cannot find or open the PDB file
......,Cannot find or open the PDB file
......,Cannot find or open the PDB file
......,已加载符号。
......,Cannot find or open the PDB file
线程 'Win32 线程' (0x11dc) 已退出,返回值为 -1 (0xffffffff)。
线程 'Win32 线程' (0x143c) 已退出,返回值为 -1 (0xffffffff)。
程序“[2284] 3.11__一个完整的窗口程序的诞生.exe: 本机”已退出,返回值为 -1 (0xffffffff)。

出错代码如下:

WNDCLASSEX wndClass;
 wndClass.cbSize = sizeof(WNDCLASSEX);
 wndClass.style = CS_HREDRAW | CS_VREDRAW;
 wndClass.lpfnWndProc = WndProc;
 wndClass.cbClsExtra = 0;
 wndClass.cbWndExtra = 0;
 wndClass.hInstance = hInstance;
 wndClass.hIcon = (HICON)::LoadImage(NULL,L"icon.ico",IMAGE_ICON,0,0,
  LR_DEFAULTSIZE | LR_LOADFROMFILE);//本地加载自定义ico图标
 wndClass.hCursor = LoadCursor(NULL,IDC_ARROW);
 wndClass.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
 wndClass.lpszMenuName = NULL;
 wndClass.lpszClassName = L"游戏开发窗口类";

捣鼓了半天,网上找也找不到解决办法。最后终于发现是wndClass.hIconSm没有赋值。如此简单的错误真是不应该。

只需把上面的WNDCLASSEX wndClass改成WNDCLASSEX wndClass={0},或者在上面代码后面加上一行wndClass.hIconSm  = 0;就行了。

另附网上大部分人说的一个方法:http://blog.csdn.net/alan00000/article/details/38495985



1 0
原创粉丝点击