Share via


Step 6, Class and File Names

OverviewsHow Do IDetails

Feature Only in Professional and Enterprise Editions   Creating a Custom AppWizard is supported only in Visual C++ Professional and Enterprise Editions. For more information, see .

The MFC AppWizard creates macros to name classes and files by combining the prefixes listed in the table “Macro Prefixes” with any of the components listed in the table “Macro Components.” For example, the value of a combined macro DOC_CLASS will be the name of the application’s document class, typically, something like “CProjectDoc.” No single application will use all combinations.

Macro Prefixes

Macro Prefix Description
DOC Refers to the application’s document class.
APP Refers to the application’s CWinApp-derived class.
FRAME Refers to the application’s main frame class (derived from CFrameWnd or CMDIFrameWnd).
CHILD_FRAME Refers to the application’s MDI child frame class (CMDIChildFrameWnd).
VIEW Refers to the application’s view class.
DLG Refers to the application’s main dialog class. Only used for a dialog-based application.
DLGAUTOPROXY Refers to the application’s Automation proxy class for the main dialog. Only used for dialog-based applications with Automation.
RECSET Refers to the application’s main recordset class.
SRVRITEM Refers to the application’s main server-item class (derived from CServerItem).
CNTRITEM Refers to the application’s main container-item class (derived from CContainerItem).
IPFRAME Refers to the application’s in-place frame class (derived from CIPFrameWnd).
TREEVIEW_CLASS The class name of the treeview for the Windows Explorer-style application.
TREEVIEW_BASE_CLASS The base class name of the treeview for the Windows Explorer-style application.
TREEVIEW_IFILE The class's implementation file name (minus extension) of the treeview for the Windows Explorer-style application.
TREEVIEW_HFILE The class's header file name (minus extension) of the treeview for the Windows Explorer-style application.
WNDVIEW_CLASS The class name of the view for the NODOCVIEW MFC application.
WNDVIEW_BASE_CLASS The base class name of the view for the NODOCVIEW MFC application.
WNDVIEW_IFILE The class's implementation file name (minus extension) of the view for the NODOCVIEW MFC application.
WNDVIEW_HFILE The class's header file name (minus extension) of the view for the NODOCVIEW MFC application.

Macro Components

Macro Component Description
_CLASS Class name.
_BASE_CLASS Base class name.
_IFILE Class implementation filename (without the extension). Both uppercase and lowercase versions of these macros are defined. If the macro name is uppercase (for example, APP_IFILE), its value will be uppercase (for example, PROJECT). If the macro name is lowercase (for example, app_ifile), its value will be lowercase (for example, project).
_HFILE Class header filename (without the extension). Both uppercase and lowercase versions of these macros are defined. If the macro name is uppercase (for example, APP_HFILE), its value will be uppercase (for example, PROJECT). If the macro name is lowercase (for example, app_hfile), its value will be lowercase (for example, project).

Only one of the following macros is defined to indicate the main view's base class.

Macro Type Description
CDaoRecordView BOOL If and only if the view derives from CdaoRecordView. Set if the user has selected a DAO database view with or without file support.
CListView BOOL If and only if the view derives from CListView.
CTreeView BOOL If and only if the view derives from CTreeView.
CRichEditView BOOL If and only if the view derives from CRichEditView.
CView BOOL If and only if the view derives from CView..
CFormView BOOL If and only if the view derives from CFormView.
CScrollView BOOL If and only if the view derives from CScrollView.
CEditView BOOL If and only if the view derives from CEditView.
CRecordView BOOL If and only if the view derives from CRecordView. Set if user has selected an ODBC database view with or without file support.
CHtmlView BOOL If and only if the view class is derived from CHtmlView.

See Also   Standard AppWizard Macros, The Dictionary, CCustomAppwiz::ProcessTemplate, CCustomAppwiz::PostProcessTemplate, How Macros Get Their Values