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

 

刚刚学习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



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值