Rename the CWizard::AddDialog() function to the CWizard::AddPage() function.
The example is as follows:
#include <Symbol.h>
#include <MyFrame.h>
int far Page1(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//Allocate instance
pDialog->CreateWindow(0, 0, 321, 240, "Page 1: 1");//Create window
pDialog->Center();//Center the window
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//Allocate and create close button
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "Previous step(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "Next step(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "Exit(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Radio Control
CRadio* pRadio1 = new CRadio(pDialog);
pRadio1->CreateObject(28, 59, 57, 24, "Male");
pRadio1->SetStatic(TRUE);
pRadio1->SetRadio(TRUE);
pRadio1->SetID(RADIOBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio2 = new CRadio(pDialog);
pRadio2->CreateObject(100, 61, 57, 24, "Female");
pRadio2->SetID(RADIOBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio3 = new CRadio(pDialog);
pRadio3->CreateObject(171, 61, 57, 24, "保密");
pRadio3->SetID(RADIOBASE + 3 - 1);
//Create Radio Control
CRadio* pRadio4 = new CRadio(pDialog);
pRadio4->CreateObject(28, 148, 57, 24, "Associate degree");
pRadio4->SetStatic(TRUE);
pRadio4->SetRadio(TRUE);
pRadio4->SetID(RADIOBASE + 4 - 1);
//Create Radio Control
CRadio* pRadio5 = new CRadio(pDialog);
pRadio5->CreateObject(100, 148, 57, 24, "Bachelor's degree");
pRadio5->SetID(RADIOBASE + 5 - 1);
//Create Radio Control
CRadio* pRadio6 = new CRadio(pDialog);
pRadio6->CreateObject(169, 148, 57, 24, "Master's degree");
pRadio6->SetID(RADIOBASE + 6 - 1);
//Create Radio Control
CRadio* pRadio7 = new CRadio(pDialog);
pRadio7->CreateObject(229, 147, 57, 24, "Doctoral degree");
pRadio7->SetID(RADIOBASE + 7 - 1);
//Create Group Control
CStatic* pGroup1 = new CStatic(pDialog);
pGroup1->CreateObject(10, 29, 285, 67, "Gender");
//Create Group Control
CStatic* pGroup2 = new CStatic(pDialog);
pGroup2->CreateObject(10, 118, 285, 66, "Degree");
//Show Window
pDialog->ShowWindow();//Show window
//go into Message Loop
int nResult = pDialog->DoModal();//Enter window message loop
//Destroy Window
delete pDialog;//Delete dialog box
return (nResult);
}
int far Page2(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//Allocate instance
pDialog->CreateWindow(0, 0, 321, 240, "Page 2: 2");//Create window
pDialog->Center();//Center the window
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//Allocate and create close button
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "Previous step(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "Next step(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "Exit(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Radio Control
CRadio* pRadio1 = new CRadio(pDialog);
pRadio1->CreateObject(28, 64, 57, 24, "Beijing");
pRadio1->SetStatic(TRUE);
pRadio1->SetRadio(TRUE);
pRadio1->SetID(RADIOBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio2 = new CRadio(pDialog);
pRadio2->CreateObject(100, 65, 57, 24, "Shanghai");
pRadio2->SetID(RADIOBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio3 = new CRadio(pDialog);
pRadio3->CreateObject(171, 65, 57, 24, "Guangzhou");
pRadio3->SetID(RADIOBASE + 3 - 1);
//Create Combo Control
CComboBox* pComboBox1 = new CComboBox(pDialog);
pComboBox1->CreateCombo(124, 122, 169, 24, NULL);
pComboBox1->SetID(COMBOBASE + 1 - 1);
//Create Group Control
CStatic* pGroup1 = new CStatic(pDialog);
pGroup1->CreateObject(10, 34, 285, 67, "Native place");
//Create a Label Control
CLabel* pLabel1 = new CLabel(pDialog);
pLabel1->CreateObject(13, 125, 67, 12, "Select year(N)");
//Show Window
pDialog->ShowWindow();//Show window
//go into Message Loop
int nResult = pDialog->DoModal();//Enter window message loop
//Destroy Window
delete pDialog;//Delete dialog box
return (nResult);
}
int far Page3(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//Allocate instance
pDialog->CreateWindow(0, 0, 321, 240, "Page 3: 3");//Create window
pDialog->Center();//Center the window
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//Allocate and create close button
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "Previous step(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "Next step(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "Exit(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Slider Control
CSliderCtrl* pSliderCtrl1 = new CSliderCtrl(pDialog);
pSliderCtrl1->CreateObject(37, 153, 241, 24, NULL);
pSliderCtrl1->SetID(SLIDERBASE + 1 - 1);
pSliderCtrl1->SetHorz(TRUE);
//Create Slider Control
CSliderCtrl* pSliderCtrl2 = new CSliderCtrl(pDialog);
pSliderCtrl2->CreateObject(138, 38, 30, 111, NULL);
pSliderCtrl2->SetID(SLIDERBASE + 2 - 1);
pSliderCtrl2->SetHorz(FALSE);
//Show Window
pDialog->ShowWindow();//Show window
//go into Message Loop
int nResult = pDialog->DoModal();//Enter window message loop
//Destroy Window
delete pDialog;//Delete dialog box
return(nResult);
}
void DemoWizard()
{
CWizard *pWizard = new CWizard;
pWizard->AddPage (Page1);
pWizard->AddPage (Page2);
pWizard->AddPage (Page3);
pWizard->DoWizard();
DELETE(pWizard);
}