文件名称:gd
介绍说明--下载内容均来自于网络,请自行研究使用
自己建立一个基于MFC的程序,并能对鼠标左键单击操作进行响应(弹出消息框)。
在程序编写过程中注意以下几点:
(1) 建立工程的类型(Win32 Application)及需要包含的头文件(afxwin.h)
(2) 从CWinApp派生自己应用程序类,从Cfr a meWnd派生自己框架窗口类
(3) 注意程序的构建过程:从应用程序类对象开始,调用基类构造函数,在其中调用InitInstance(),因其为虚函数,会调用自己重载的InitInstance(),我们可以在其中创建窗口。
(4) 在MFC程序中使用宏进行消息映射, 消息的处理放在框架程序中。
BEGIN_MESSAGE_MAP(…,…)
…//消息映射宏
END_MESSAGE_MAP
-Build a MFC-based program, and can operate on the left mouse button click to respond (pop-up message box). In the programming process note the following: (1) the establishment of project types (Win32 Application) and the need to include the header file (afxwin.h) (2) derived from its own application class CWinApp, Cfr a meWnd derived from their own fr a me window class (3) Note that the program construction process: starting from the application class object, call the base class constructor, in which the call to InitInstance (), because the virtual function will call itself overloaded InitInstance (), in which we can create window. (4) use the macro in the MFC program for message maps, message handling on the fr a mework of the program. BEGIN_MESSAGE_MAP (..., ...) ...// Message map macros END_MESSAGE_MAP
在程序编写过程中注意以下几点:
(1) 建立工程的类型(Win32 Application)及需要包含的头文件(afxwin.h)
(2) 从CWinApp派生自己应用程序类,从Cfr a meWnd派生自己框架窗口类
(3) 注意程序的构建过程:从应用程序类对象开始,调用基类构造函数,在其中调用InitInstance(),因其为虚函数,会调用自己重载的InitInstance(),我们可以在其中创建窗口。
(4) 在MFC程序中使用宏进行消息映射, 消息的处理放在框架程序中。
BEGIN_MESSAGE_MAP(…,…)
…//消息映射宏
END_MESSAGE_MAP
-Build a MFC-based program, and can operate on the left mouse button click to respond (pop-up message box). In the programming process note the following: (1) the establishment of project types (Win32 Application) and the need to include the header file (afxwin.h) (2) derived from its own application class CWinApp, Cfr a meWnd derived from their own fr a me window class (3) Note that the program construction process: starting from the application class object, call the base class constructor, in which the call to InitInstance (), because the virtual function will call itself overloaded InitInstance (), in which we can create window. (4) use the macro in the MFC program for message maps, message handling on the fr a mework of the program. BEGIN_MESSAGE_MAP (..., ...) ...// Message map macros END_MESSAGE_MAP
(系统自动生成,下载前可以参看下载内容)
下载文件列表
gd.doc