Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Why does my property sheet has disappeared immediately? [solved]

Why does my property sheet has disappeared immediately? [solved]

Scheduled Pinned Locked Moved C / C++ / MFC
question
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PCuong1983
    wrote on last edited by
    #1

    I have a dialog based application named: basicreport and created one dialog called: CExternalDataDlg , 3 property page called: CImportPage, COptionPage, CConfirmPage and 1 property sheet named: CImportPropertySheet. inside: BOOL CBasicReportApp::InitInstance()

    BOOL CBasicReportApp::InitInstance(){
    ......
    CExternalDataDlg dlg;
    m_pMainWnd = &dlg;
    INT_PTR nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
    // TODO: Place code here to handle when the dialog is
    // dismissed with OK

    }
    else if (nResponse == IDCANCEL)
    {
    	// TODO: Place code here to handle when the dialog is
    	//  dismissed with Cancel
    	
    }
        return FALSE;
    

    }

    CExternalDataDlg displayed correctly, worked fine! I have change above code to:

    BOOL CBasicReportApp::InitInstance(){
    ......
    CImportPropertySheet importWizardSheet(_T("Import Spreadsheet Wizard"));
    CImportPage importpage;
    COptionPage optionpage;
    CConfirmPage confirmpage;

    importWizardSheet.AddPage(&importpage);
    importWizardSheet.AddPage(&optionpage);
    importWizardSheet.AddPage(&confirmpage);
    importWizardSheet.SetWizardMode();
    
    
    m\_pMainWnd = &importWizardSheet;
    
    INT\_PTR nWizardResponse = importWizardSheet.DoModal();
    if(nWizardResponse == ID\_WIZFINISH){
    	AfxMessageBox(\_T("Importing..........."));
    }
    else if(nWizardResponse == IDCANCEL){
    	AfxMessageBox(\_T("Cancel"));
    }
    else{
    }
        return FALSE;
    

    }

    CImportPropertySheet displayed correctly, worked fine! but when i combinated the both above into once. It looked like

        CExternalDataDlg dlg;
    m\_pMainWnd = &dlg;
    INT\_PTR nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
    	// TODO: Place code here to handle when the dialog is
    	//  dismissed with OK
    	CImportPropertySheet importWizardSheet(\_T("Import Spreadsheet Wizard"));
    	CImportPage importpage;
    	COptionPage optionpage;
    	CConfirmPage confirmpage;
    
    	importWizardSheet.AddPage(&importpage);
    	importWizardSheet.AddPage(&optionpage);
    	importWizardSheet.AddPage(&confirmpage);
    	importWizardSheet.SetWizardMode();
    	
    	INT\_PTR nWizardResponse = importWizardSheet.DoModal();
    	if(nWizardResponse == ID\_WIZFINISH){
    		AfxMessageBox(\_T("Importing..........."));
    	}
    	else if(nWizardResponse == IDCANCEL){
    		AfxMessageBox(\_T("Cancel"));
    	}
    	else{
    	}
    }
    else if (nResponse == IDCANCEL)
    {
    	// TODO: Place code here to handle when the dialog is
    	//  dismissed with Cancel
    	return FALSE;
    
    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups