请帮忙看一下这个C++程序有什么错误

来源:百度知道 编辑:UC知道 时间:2024/06/25 21:51:30
这是一个project里的一个文件:
#include <windows.h>
#include <stdio.h>

LRESULT CALLBACK WinSunProc
(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);

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_CROSS);
wndcls.hIcon=LoadIcon(NULL,IDI_ERROR);
wndcls.hInstance=hInstance;
wndcls.lpfnWndProc=WinSunProc;
wndcls.lpszClassName="ytp";
wndcls.lpszMenuName=NULL;
wndcls.style=CS_HREDRAW | CS_VREDRAW;
RegisterClass (&wndcls);

HWND hwnd;
hwnd=CreateWindow ("ytp","tianpengyuanshuai",W

可能建错项目了
http://hi.baidu.com/%B4%C5%C1%F7/blog/item/9c4dd1df6db45a1b49540390.html这个网址将得比较全面自己去看下吧

我知道你的错误,项目建错了,你这个程序是win32程序,但你建的虽然是Win32 Application但是选的是控制台程序,所以链接会出错。