Microsoft KB Archive/152255

= PRB: Custom AppWizard Doesn't Initialize Custom Step Dialogs =

Article ID: 152255

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 4.0 Standard Edition

 Microsoft Visual C++ 4.1 Subscription

 Microsoft Visual C++ 5.0 Enterprise Edition

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

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

 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 Q152255

<div class="symptoms_section">

SYMPTOMS
Custom AppWizards with some custom steps do not pick up initialization values for the dialog's controls for these steps from the Resource Editor.

For instance, if the custom step's dialog template contains a Combo Box, the strings for the Combo Box can be entered in the Resource Editor itself. When the Wizard is built and run, and when the custom step containing the Combo Box comes up, the strings don't show up in the Combo Box. The same also happens with a picture control with a bitmap associated with it.

<div class="cause_section">

CAUSE
For the custom step dialog boxes, Custom AppWizards ignore any initialization information setup in the Resource Editor.

<div class="resolution_section">

RESOLUTION
Each custom step's dialog template has a corresponding CAppWizStepDlg- derived class. The necessary initialization should be done in this class's OnInitDialog member function. Because this function is called before the dialog is visible to the user, the effect is as if the initializations were done in the Resource Editor.

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

MORE INFORMATION
Custom AppWizards are of three types with only two of these types supporting custom dialog steps. The problem discussed in this article shows up in both these types.

Sample Code
BOOL CCustomDialog::OnInitDialog {      CAppWizStepDlg::OnInitDialog; // Initialize the combo box CComboBox* pCombo = (CComboBox* )GetDlgItem(IDC_COMBO); pCombo->AddString("Hello"); pCombo->AddString("World"); // Initialize the picture control m_Bitmap.LoadBitmap(IDB_MYBITMAP); CStatic* pStatic = (CStatic* )GetDlgItem(IDC_PICSTATIC); pStatic->SetBitmap(m_Bitmap); return TRUE; }

Keywords: kbcustomwizard kbpending kbprb kbwizard KB152255

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.