学VC编程的高手帮忙解决下我的这程序怎么运行不了??我刚入门

来源:百度知道 编辑:UC知道 时间:2024/05/04 11:47:53
程序如下// 003.cpp : Defines the entry point for the application.
//
#include "stdafx.h"

#include"windows.h"
#include"stdlib.h"
#include"string.h"
long WINAPI WndProc(HWND hWnd,UINT iMessage ,UINT wParam,LONG lParam);
BOOL InitWindowsClass(HINSTANCE hInstance);
BOOL Initwindows(HINSTANCE hInstance,int nCmdShow);

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG Message;
if(!InitWindowsClass(hInstance))
return FALSE;
if(!InitWindows(hInstance,nCmdShow))
return FALSE;
while(GetMessage(&Message,0,0,0))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return Message.wParam;

}
long WINAPI WndProc (HWND hWnd ,UINT iMessge,UINT w

刚入门就这么专业!
我只能说:对不起,我还没入门!

不用include那麼多,只需#include"windows.h"
函数的声明和定义不一致
正确的是:
//#include "stdafx.h"

#include"windows.h"

//#include"stdlib.h"
//#include"string.h"
long WINAPI WndProc(HWND hWnd,UINT iMessage ,UINT wParam,LONG lParam);
BOOL InitWindowsClass(HINSTANCE hInstance);
BOOL InitWindows(HINSTANCE hInstance,int nCmdShow);

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
MSG Message;
if(!InitWindowsClass(hInstance))
return FALSE;
if(!InitWindows(hInstance,nCmdShow))
return FALSE;
while(GetMessage(&Message,0,0,0))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return Message.wParam;

}

BOOL InitWindowsClass(HINSTANCE hInstance)
{