FIX: Custom AppWizard May Ignore Changes to Predefined Macros (181511)
The information in this article applies to:
- The AppWizard, when used with:
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 4.2
This article was previously published under Q181511 SYMPTOMS
In a Custom AppWizard based on standard AppWizard steps, the wizard
framework may ignore changes that custom steps make to predefined wizard
macros. The standard AppWizard steps define and use such predefined
macros; for example, the macro VERBOSE conditionally generates elaborate
comments in the destination project's source files.
CAUSE
A custom AppWizard's custom step usually makes changes to the macro table
stored in m_Dictionary during OnDismiss, a function called when the user
exits the page. However, clicking the Custom AppWizard's Finish button also
sets the values of predefined macros, based on internal values stored by
the standard AppWizard steps. If a custom step changes a macro that a
standard step controls, the internal value stored by the standard step is
unaffected. So, when Finish sets the predefined macros, such changes made
by custom steps are effectively ignored.
RESOLUTION
Instead of modifying predefined macros in OnDismiss, override the virtual
function CCustomAppWiz::ProcessTemplate. Alternatively, preset the macro's
value in Init.
These techniques also work in Visual C++ version 5, even though the bug is
fixed in this version.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been corrected in the
AppWizard included with Visual C++, 32-bit editions, version 5.0.
Modification Type: | Major | Last Reviewed: | 12/8/2003 |
---|
Keywords: | kbBug kbcode kbfix kbVC500fix kbwizard KB181511 |
---|
|