How To Show A Dialog Box in a Property Page 
Author Message
 How To Show A Dialog Box in a Property Page

Hi,

Wow, this should be easy but it is giving me a lot of grief.

I cannot show a CDialog derived class from within a custom "wizard" I am
creating at the moment. The dialog pops up and goes out of scope or
something immediately (because it is barely seen and then messes everything
up because I lose focus to the wizard).

Suggestions welcome.

Thanks in advance:

-Chris

Here's some code:

void CMainFrame::OnFileWizard()
{
   m_pwndWizard = new CWizard("Sample Wizard", this); // where class CWizard
: public CPropertySheet
   ASSERT_VALID(m_pwndWizard);

   // Construct two property pages to keep things short and sweet for the
newsgroup post
   m_pdlgIntro = new CPropPageIntro;
   ASSERT_VALID(m_pdlgIntro);
   m_pdlgIntro->Construct(IDD_PROPPAGEINTRO, 0);

   m_pdlgCustomer = new CPropPageCustomer; // where class CPropPageCustomer
: public CPropertyPage
   m_pdlgCustomer->Construct(IDD_PROPPAGECUSTOMER, 0);

   // Add the property pages to the property sheet
   m_pwndWizard->AddPage(m_pdlgIntro);
   m_pwndWizard->AddPage(m_pdlgCustomer);

   // Make the property sheet a Wizard
   m_pwndWizard->SetWizardMode();

   // Display the Wizard
   m_pwndWizard->DoModal();

Quote:
}

Then:
void CPropPageCustomer::OnButtonnewcustomer()
{
 CDlgNewCustomer dlg;
 dlg.DoModal(); //where are you?
Quote:
}



Mon, 15 Aug 2005 19:31:50 GMT  
 How To Show A Dialog Box in a Property Page
From your description I believe the wizard or parent
window takes focus away from the dialog box.  Add some
break points in the dialog object class and see at what
point it loses focus.

Kuphryn



Mon, 15 Aug 2005 19:41:50 GMT  
 How To Show A Dialog Box in a Property Page
Oops,

Turns out the style of the dialog was set to a child style instead of pop
up.

I actually took this resource from another application we had and neglected
to look at the dialog style ;)

-Chris



Tue, 16 Aug 2005 19:03:41 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. The same dialog box for a stand alone dialog and a property page

2. Handling TAB in a dialog box with a property pages within it

3. Property page and Modalless dialog box

4. Dialog boxes with property pages

5. set an arbitrary printer driver in print dialog box without showing the print dialog box

6. how to set an arbitrary printer driver in print dialog box without showing the dialog box

7. Property Page not Showing in VB

8. Showing one's property pages

9. Property page does not show underline

10. MSChart show property pages problem

11. Property Sheet shows first page active

12. Adding property pages dynamically don't show up

 

 
Powered by phpBB® Forum Software