Displaying a modal dialog from within a property sheet/page 
Author Message
 Displaying a modal dialog from within a property sheet/page

I'm trying to launch a modal dialog when the user hits a button on one
of my property pages, but the application locks on DoModal().  I found
a message on this forum giving this advice:

"You have to make sure you modify the style of your property sheet:

m_PropSheet->ModifyStyleEx(0, WS_EX_CONTROLPARENT);

Otherwise there is a problem when the pages lose the focus (ie by
calling a modal dialog box)..."

but it had no effect.  I tried two implementations:

BOOL CScheduleSheet::PreCreateWindow(CREATESTRUCT& cs)
{
        cs.dwExStyle |= WS_EX_CONTROLPARENT;
        return CPropertySheet::PreCreateWindow(cs);

Quote:
}

BOOL CScheduleSheet::OnInitDialog()
{
        ModifyStyleEx(0, WS_EX_CONTROLPARENT);
        return CPropertySheet::OnInitDialog();

Quote:
}

PreCreateWindow() doesn't get called (?!), but OnInitDialog() does.
I'm using Visual C++ 6 SP3.  The other guy was using VC++ 5.

Any suggestions?

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sat, 27 Jul 2002 03:00:00 GMT  
 Displaying a modal dialog from within a property sheet/page
Never mind.  When I converted my dialog from a property page back to a
modal dialog, I didn't reset the dialog resource flags accordingly
(from Child to Popup, etc).  Argh!  It works now.  Setting
WS_EX_CONTROLPARENT was not necessary.

(These things are always much more obvious AFTER a public plea for
help...)


Quote:

> I'm trying to launch a modal dialog when the user hits a button on one
> of my property pages, but the application locks on DoModal().  I found
> a message on this forum giving this advice:

> "You have to make sure you modify the style of your property sheet:

> m_PropSheet->ModifyStyleEx(0, WS_EX_CONTROLPARENT);

> Otherwise there is a problem when the pages lose the focus (ie by
> calling a modal dialog box)..."

> but it had no effect.  I tried two implementations:

> BOOL CScheduleSheet::PreCreateWindow(CREATESTRUCT& cs)
> {
>    cs.dwExStyle |= WS_EX_CONTROLPARENT;
>    return CPropertySheet::PreCreateWindow(cs);
> }

> BOOL CScheduleSheet::OnInitDialog()
> {
>    ModifyStyleEx(0, WS_EX_CONTROLPARENT);
>    return CPropertySheet::OnInitDialog();
> }

> PreCreateWindow() doesn't get called (?!), but OnInitDialog() does.
> I'm using Visual C++ 6 SP3.  The other guy was using VC++ 5.

> Any suggestions?

Sent via Deja.com http://www.deja.com/
Before you buy.


Sat, 27 Jul 2002 03:00:00 GMT  
 Displaying a modal dialog from within a property sheet/page

Quote:

>Never mind.  When I converted my dialog from a property page back to a
>modal dialog, I didn't reset the dialog resource flags accordingly
>(from Child to Popup, etc).  Argh!  It works now.  Setting
>WS_EX_CONTROLPARENT was not necessary.

>(These things are always much more obvious AFTER a public plea for
>help...)

But you don't get to hear the communal sigh of relief of onlookers
thinking "Thank God I'm not the only one..."


Sun, 04 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Displaying a modal dialog from within a property sheet/page

2. Displaying a modal dialog from within a property sheet/page Located in DLL

3. ActiveX Property Pages within client Property Sheet????

4. Property Sheet within a Property Sheet

5. Q: Property sheet within a property sheet

6. property sheet wizard - using Help button to throw modal dialog and not use .HLP

7. Displaying ActiveX property pages within the client

8. modal property sheet looses modal behavior after error message

9. Property sheet within a dialog

10. Resizing Property Sheets within a Dialog box

11. Creating property sheet within a dialog

12. Modal Dialog from Modless Property Page

 

 
Powered by phpBB® Forum Software