Microsoft KB Archive/189073

= BUG: Step 2 of the MFC AppWizard Does Not Set Macro Values =

Article ID: 189073

Article Last Modified on 12/8/2003

-

APPLIES TO

 The AppWizard, when used with:  Microsoft Visual C++ 5.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 5.0 Professional Edition

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q189073

<div class="symptoms_section">

SYMPTOMS
When you use a Custom AppWizard that uses the Standard AppWizard step defined by the APWZDLG_DLGAPPOPTIONS dialog box (Step 2), the macro values associated with this dialog box do not get set when the Next button is clicked.

<div class="resolution_section">

RESOLUTION
The macro values are set when the Next button or the Back button of the APWZDLG_PROJOPTIONS dialog is clicked (Step 3). The TITLE macro is an exception. This macro is not set until the Finish button is selected.

<div class="status_section">

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

<div class="moreinformation_section">

MORE INFORMATION
The APWZDLG_DLGAPPOPTIONS dialog has the following associated macros: <pre class="fixed_text">  ABOUT        Whether the standard MFC AppWizard user or Custom AppWizard user has specified that the dialog-based application include an About box. Default value is ON.

HELP        Whether the standard MFC AppWizard user or custom AppWizard user has specified that the application have context-sensitive help. Default value is OFF.

3D          Whether the standard MFC AppWizard user or custom AppWizard user has specified that the application use 3D controls. Default value is ON.

AUTOMATION  Whether the standard MFC AppWizard user or custom AppWizard user has selected Automation support. Default value is OFF.

OLECTL      Whether the application supports using ActiveX Controls. Default value is ON.

SOCKETS     Whether the standard MFC AppWizard user or custom AppWizard user has specified that the project have Windows Sockets support. Default value is OFF.

TITLE       The caption string for an application's main title bar or, in a dialog-based application, the dialog's title. Default value is the name of the project.

Steps to Reproduce Behavior
<ol> Create a Custom AppWizard based on Standard MFC AppWizard steps.</li>  In your Custom AppWizard's CDialogChooser::Next and CDialogChooser::Back functions, add the following code: // Look up the value associated with the ABOUT macro. // Replace <MyCustomAWProj> with your custom AppWizard project name. // See "CCustomAppWiz::m_Dictionary" in the on-line documentation. CString strAbout; if( !<MyCustomAWProj>aw.m_Dictionary.Lookup(_T("ABOUT"), strAbout) ) strAbout = "ABOUT is not defined in the dictionary"; else strAbout = "ABOUT is " + strAbout; AfxMessageBox( strAbout ); </li> Build your Custom AppWizard by selecting Build from the main menu or by entering F7.</li> Create a new project based on a Custom AppWizard.</li> In Step 1, select "Dialog based" as the type of application to create, and click the Next button. The message box will show that the ABOUT macro is set.</li> In Step 2, clear the About Box check box, and click the Next button. The message box still shows the ABOUT macro is set.</li> In Step 3, click the Next button or the Back button. The message box now shows that the ABOUT macro is undefined.</li></ol>

This behavior is the same for the macros in the MORE INFORMATION section of this article with the exception of TITLE. This macro is not defined until the Finish button is clicked.

<div class="references_section">