win32 api和MFC编程的标准头文件和主函数是什么啊

来源:百度知道 编辑:UC知道 时间:2024/05/16 06:06:50
问题有点太长了,现在我对Win32 API和MFC不是很清楚,我想问的是Win32 API和MFC编程里用的标准头文件是什么啊还有主函数是什么啊?

例)
在C语言的话标准头文件是#include <stdio.h>,然后主函数是int main()这样嘛,我想问的是Win32 API编程和MFC编程里是怎么样的啊?

请详细给个说明好吗?
谢谢!!

MFC编程:http://images.163.com/images/it/books/vc/chap2/chap2_4.htm

MFC编程里用的标准头文件#include <afxwin.h>
Win32 大多数API,用 #include <windows.h>
mfc都给封装起来了,所以自己不用写
mfc程序的主函数是这样的,在appmodule.cpp里面
extern "C" int WINAPI
_tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
// call shared/exported WinMain
return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}
//简单的mfc
//hello.cpp

#include <afxwin.h>

// Declare the application class
class CHelloApp : public CWinApp
{
public:
virtual BOOL InitInstance();
};

// Create an instance of the application class
CHelloApp HelloApp;

// Declare the main window class
class CHelloWindow : public CFrameWnd