Cannot find or open the PDB file?

clever_boy010 2012-02-21 07:40:25
Cannot find or open the PDB file?
程序代码:
#include <windows.h>

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR iCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT("Draw a point!");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;

wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.hInstance = hInstance;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.lpszClassName = szAppName;
wndclass.lpszMenuName = NULL;

if (!RegisterClass(&wndclass))
{
MessageBox(NULL, TEXT("This program requires windows NT!"), szAppName, MB_ICONERROR);
return 0;
}

hwnd = CreateWindow (szAppName, TEXT("One Point"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);

if(hwnd == NULL)
{
MessageBox(NULL, TEXT("No more memory for CreateWindow!"), szAppName, MB_ICONERROR);
return 0;
}

ShowWindow(hwnd, iCmdShow);
UpdateWindow(hwnd);

while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}

return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static int cxClient, cyClient;
HDC hdc;
PAINTSTRUCT ps;
int i;

switch (message)
{
case WM_CREATE:
cxClient = LOWORD(lParam);
cyClient = HIWORD(lParam);
return 0;
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
MoveToEx(hdc, 0, cyClient/2, NULL);
LineTo(hdc,cxClient, cyClient/2);
MoveToEx(hdc, cxClient/2, 0, NULL);
LineTo(hdc, cxClient/2, cyClient);
EndPaint(hwnd,&ps);
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}

这个是画个十字交叉的两条直线的程序,运行后屏幕一闪而过?
“画点004.exe”: 已加载“D:\project\C++\画点004\Debug\画点004.exe”,已加载符号。
“画点004.exe”: 已加载“C:\WINDOWS\system32\ntdll.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\kernel32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\user32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\gdi32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\msvcr100d.dll”,已加载符号。
“画点004.exe”: 已加载“C:\WINDOWS\system32\imm32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\advapi32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\rpcrt4.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\secur32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\lpk.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\usp10.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\uxtheme.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\msvcrt.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\Program Files\360\360Safe\safemon\safemon.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\shell32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\shlwapi.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\ole32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\oleaut32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\msvcp60.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\wininet.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\crypt32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\msasn1.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\psapi.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\ws2_32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\ws2help.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\version.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\comctl32.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\MSCTF.dll”,Cannot find or open the PDB file
“画点004.exe”: 已加载“C:\WINDOWS\system32\msctfime.ime”,Cannot find or open the PDB file
程序“[3320] 画点004.exe: 本机”已退出,返回值为 0 (0x0)。
什么原因,怎么弄。
...全文
1104 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
梦境传说 2014-06-26
  • 打赏
  • 举报
回复
我也同样的问题,VS2010调试编译的时候出现:Cannot find or open the PDB file。 楼主解决了吗? 分享给大家,谢谢!
小白也疯狂 2013-05-22
  • 打赏
  • 举报
回复
WM_PAINT 消息处理之后,没有break,然后直接执行了WM_DESTROY
clever_boy010 2012-02-21
  • 打赏
  • 举报
回复
谢谢!
Jim_King_2000 2012-02-21
  • 打赏
  • 举报
回复
因为你的窗口大小是在WM_CREATE消息中得到的,而后面窗口的大小会改变。你应该在WM_PAINT消息中直接得到客户区的大小。
clever_boy010 2012-02-21
  • 打赏
  • 举报
回复
我在调试下把Microsoft符号服务器打了√,然后加载。
运行的结果MoveToEx(hdc, 0, cyClient/2, NULL);
LineTo(hdc,cxClient, cyClient/2);
本来应该是在窗口中间的一条直线,为什么运行后变成离窗口顶部很近(1厘米不到)的一条直线?
Jim_King_2000 2012-02-21
  • 打赏
  • 举报
回复
这些是系统模块,需要调试符号的话,按照下面文章来设置。
http://support.microsoft.com/kb/311503/

65,202

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧