BUG: Step 2 of the MFC AppWizard Does Not Set Macro Values
ID: Q189073
|
The information in this article applies to:
-
The AppWizard, included with:
-
Microsoft Visual C++, 32-bit Editions, versions 5.0, 6.0
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.
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.
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.
MORE INFORMATION
The APWZDLG_DLGAPPOPTIONS dialog has the following associated macros:
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
- Create a Custom AppWizard based on Standard MFC AppWizard steps.
- 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 );
- Build your Custom AppWizard by selecting Build from the main menu or by
entering F7.
- Create a new project based on a Custom AppWizard.
- 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.
- In Step 2, clear the About Box check box, and click the Next button. The
message box still shows the ABOUT macro is set.
- In Step 3, click the Next button or the Back button. The message box
now shows that the ABOUT macro is undefined.
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.
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
Q186895 BUG: Custom AppWizard Errors with Applications That Have Help
Visual C++ Programmer's Guide: Beginning Your Program; Creating Custom
AppWizards
Visual C++ Programmer's Guide: Beginning Your Program; Details
Additional query words:
Keywords : kbwizard kbide kbVC500bug kbVC600bug kbGrpDSTools
Version : WINNT:5.0,6.0
Platform : winnt
Issue type : kbbug