Share via


How to Specify Macros in Directives or Text

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 .

A macro name that is used as an argument to a directive, such as $$IF, does not need dollar signs ($$) to mark its beginning and end; any dollar signs found are interpreted as part of the macro’s name. For instance, the CCustomAppWiz::ProcessTemplate function’s parser treats both AMACRO and $$AMACRO$$ as macro names in the following two directive statements:

$$IF(AMACRO);
$$IF($$AMACRO$$);

A macro name in text, however, requires dollar signs ($$) to mark its beginning and end, as shown in the following fragment extracted from one of AppWizard’s custom resource templates:

///////////////////////////////////////////////////////
// $$APP_CLASS$$

BEGIN_MESSAGE_MAP($$APP_CLASS$$, $$APP_BASE_CLASS$$)
   //{{AFX_MSG_MAP($$APP_CLASS$$)
$$IF(VERBOSE)
      // NOTE - the ClassWizard will add and
      //      remove mapping macros here.
      //    DO NOT EDIT what you see in these
      //      blocks of generated code!
$$ENDIF
   //}}AFX_MSG
   ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

For more information on macros, see How Macros Get Their Values.

What do you want to know more about?