📄 subject_40234.htm
字号:
<p>
序号:40234 发表者:梁杨在线 发表日期:2003-05-16 18:17:40
<br>主题:错在哪里?
<br>内容:#include <windows.h><BR>LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);<BR><BR>int WINAPI WinMain(HINSTANCE hInstance,<BR> HINSTANCE hPrevInst,<BR> LPSTR lpszCmdLine,<BR> int nCmdShow)<BR>{<BR> HWND hWnd;<BR> WNDCLASS wndclass;<BR> MSG Msg;<BR> char lpszClassName[]="窗口";<BR> char lpszTitle[]="My_Windows";<BR><BR> wndclass.style=0;<BR> wndclass.lpfnWndProc=WndProc;<BR> wndclass.cbClsExtra=0;<BR> wndclass.cbWndExtra=0;<BR> wndclass.hInstance=hInstance;<BR> wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);<BR> wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);<BR> wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);<BR> wndclass.lpszMenuName=NULL;<BR> wndclass.lpszClassName=lpszClassName;<BR><BR> if(!RegisterClass(&wndclass))<BR> {<BR> MessageBeep(0);<BR> return FALSE;<BR> }<BR><BR> hWnd=CreateWindow(lpszClassName,<BR> lpszTitle,<BR> WS_OVERLAPPEDWINDOW,<BR> CW_USEDEFAULT,<BR> CW_USEDEFAULT,<BR> CW_USEDEFAULT,<BR> CW_USEDEFAULT,<BR> NULL,<BR> NULL,<BR> hInstance,<BR> NULL);<BR><BR> ShowWindow(hWnd,nCmdShow);<BR> UpdateWindow(hWnd);<BR><BR> while (GetMessage(&Msg,NULL,0,0))<BR> {<BR> TranslateMessage(&Msg);<BR> DispatchMessage(&Msg);<BR> }<BR><BR> return Msg.wParam;<BR>}<BR><BR>LRESULT CALLBACK WndProc(HWND hWnd,<BR> UINT message,<BR> WPARAM wParam,<BR> LPARAM lParam)<BR>{<BR> switch (message)<BR> {<BR> case WM_DESTROY:<BR> PostQuitMessage(0);<BR> default:<BR> return DefWindowProc(hWnd,message,wParam,lParam);<BR> }<BR> return (0);<BR>}<BR><BR><BR><BR>Linking...<BR>LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main<BR>Debug/liang.exe : fatal error LNK1120: 1 unresolved externals<BR>Error executing link.exe.<BR><BR>liang.exe - 2 error(s), 0 warning(s)<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:theta 回复日期:2003-05-16 18:29:55
<br>内容:可能是项目类型没对,感觉像是选成了Windows Console Application
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:梁杨在线 回复日期:2003-05-16 18:36:09
<br>内容:乖乖, 真的是啊<BR>我太急了
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -