CreateWindow
#include <windows.h>#include <stdio.h>
#include <tchar.h>
LRESULT CALLBACK WinHuangProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
int WINAPI WinMain(
HINSTANCE hInstance, // handle to current instance
HINSTANCE hPrevInstance, // handle to previous instance
LPSTR lpCmdLine, // command line
int nCmdShow // show state
)
{
WNDCLASS wndcls;
wndcls.cbClsExtra=0;
wndcls.cbWndExtra=0;
wndcls.hbrBackground=(HBRUSH) GetStockObject(BLACK_BRUSH);
wndcls.hCursor=LoadCursor(NULL,IDC_ARROW);
wndcls.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wndcls.hInstance=hInstance;
wndcls.lpfnWndProc=WinHuangProc;
wndcls.lpszClassName=_T("Huang");
wndcls.lpszMenuName=NULL;
wndcls.style=CS_HREDRAW | CS_VREDRAW;
RegisterClass(&wndcls);
HWND hwnd;
hwnd=CreateWindow(_T("Huang",_T("happy"),WS_OVERLAPPED,0,0,500,500,NULL,NULL,hInstance,NULL);//这个地方说错误地终止了宏调用,CreateWindow提示错误
ShowWindow(hwnd,SW_SHOWNORMAL);
MSG msg;
while(GetMessage(&msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return 0;
}
c:\users\huang\documents\visual studio 2010\projects\winmain\winmain\winmain.cpp(38): fatal error C1057: 宏扩展中遇到意外的文件结束
用的是visual studio 2010,整了半天了,急死了