再探MFC(一)基于对话框的MFC项目架构

大学毕设时学的MFC,工作头一年还用的MFC,之后再也用不到了.当时买的MFC书籍早就束之高阁了.现在需要开发一个简单的桌面程序,于是我又把MFC捡起来.MFC早已过时,不过如果开发简单的Windows桌面应用,MFC不失为一个简单的选择.

对话框

The CDialogEx class specifies the background color and backgroundimage of a dialog box.

The base class used for displaying dialog boxes on the screen.

Dialog boxes are of two types: modal andmodeless. A modal dialog box must be closed by the user before the applicationcontinues. A modeless dialog box allows the user to display the dialog box andreturn to another task without canceling or removing the dialog box.

A modal dialog boxcloses automatically when the user presses the OK or Cancel buttons or whenyour code calls the EndDialog member function.

When you implement amodeless dialog box, always override the OnCancel member function and callDestroyWindow from within it. Don’t call the base class CDialog::OnCancel,because it calls EndDialog, which will make the dialog box invisible but willnot destroy it. You should also override PostNcDestroy for modeless dialogboxes in order to delete this, since modeless dialog boxes are usuallyallocated with new. Modal dialog boxes are usually constructed on the frame anddo not need PostNcDestroy cleanup.

Provides the base functionality of all window classes in theMicrosoft Foundation Class Library.

应用程序

The base class from which you derive a Windows application object.

,你在雨中行走,你从不打伞,你有自己的天空,它从不下雨。

再探MFC(一)基于对话框的MFC项目架构

相关文章:

你感兴趣的文章:

标签云: