求助,请各位大神帮忙解决一下SDK的问题
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){
HBITMAP hbmp;
HDC srchdc;
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
POINT pt;
STRING szString[100];
switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// 分析菜单选择:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
break;
case IDM_EXIT:
if(IDYES==MessageBox(hWnd,TEXT("真的要退出吗?"),TEXT("注意"),MB_YESNO))
DestroyWindow(hWnd);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
hbmp=LoadBitmap(hInst,(LPCTSTR)IDB_HEAD);
srchdc=CreateCompatibleDC(hdc);
SelectObject(srchdc,hbmp);
BitBlt(hdc,0,0,1024,800,srchdc,0,0,SRCCOPY);
DeleteObject(hbmp);
DeleteObject(srchdc);
RECT rt;
GetClientRect(hWnd,&rt);
DrawText(hdc,TEXT("Hello World"),strlen("Hello World"),&rt,DT_BOTTOM|DT_LEFT);
// TODO: 在此添加任意绘图代码...
EndPaint(hWnd, &ps);
break;
case WM_MOUSEMOVE:
pt.x=LOWORD(lParam);
pt.y=HIWORD(lParam);
//sprintf(szString,"[ %d, %d]",pt.x,pt.y);
hdc=GetDC(hWnd);
TextOut(hdc,300,200,TEXT(szString),200);
ReleaseDC(hWnd,hdc);
//......
break;
红色部分的哪里错了,为什么编译的时候会出现这样的情况,我用的版本是visual studio 2008的。各位大神帮帮忙!3Q