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

Hi,

I'm using Visual C++ 5.0 and MFC. I have a property sheet with several
property pages, and I want to be able to display a modal dialog box as
a child to one of these property pages (i.e. by pressing a button, on
the property page).

I've tried the normal way of displaying a modal dialog box, and the
code is as follows (the code is within the message handler for the
button):

        CAddressDlg Dlg(this);
        ....
        ....
        Dlg.DoModal();

When the code gets to DoModal(), it fails; after debugging, it seems
that the SetWindowText() function fails on assertion because for some
reason the window doesn't get created, as it would normally when you
call DoModal().

Any help is appreciated. Thanks.
Mohsen



Mon, 30 Jul 2001 03:00:00 GMT  
 Displaying a modal dialog from within a property sheet/page

Quote:

> Hi,

> I'm using Visual C++ 5.0 and MFC. I have a property sheet with several
> property pages, and I want to be able to display a modal dialog box as
> a child to one of these property pages (i.e. by pressing a button, on
> the property page).

> I've tried the normal way of displaying a modal dialog box, and the
> code is as follows (the code is within the message handler for the
> button):

>         CAddressDlg Dlg(this);
>         ....
>         ....
>         Dlg.DoModal();

> When the code gets to DoModal(), it fails; after debugging, it seems
> that the SetWindowText() function fails on assertion because for some
> reason the window doesn't get created, as it would normally when you
> call DoModal().

> Any help is appreciated. Thanks.
> Mohsen

Nothing special here: It should work.  Try checking that dialog in a little test app or something.


Mon, 30 Jul 2001 03:00:00 GMT  
 Displaying a modal dialog from within a property sheet/page
Hi,

I'm using Visual C++ 5.0 and MFC. I have a property sheet with several
property pages, and I want to be able to display a modal dialog box as
a child to one of these property pages (i.e. by pressing a button, on
the property page).

I've tried the normal way of displaying a modal dialog box, and the
code is as follows (the code is within the message handler for the
button):

        CAddressDlg Dlg(this);
        ....
        ....
        Dlg.DoModal();

When the code gets to DoModal(), it fails; after debugging, it seems
that the SetWindowText() function fails on assertion because for some
reason the window doesn't get created, as it would normally when you
call DoModal().

PS. Both the Property page and the dialog box are being called from
within a MFC regular DLL.

Any help is appreciated. Thanks.
Mohsen



Mon, 30 Jul 2001 03:00:00 GMT  
 Displaying a modal dialog from within a property sheet/page
Make sure you have the 'visible' attribute set for the dialog resource.
Additionally, you can try removing the (this) argument when you instantiate
the dialog.


Quote:
>Hi,

>I'm using Visual C++ 5.0 and MFC. I have a property sheet with several
>property pages, and I want to be able to display a modal dialog box as
>a child to one of these property pages (i.e. by pressing a button, on
>the property page).

>I've tried the normal way of displaying a modal dialog box, and the
>code is as follows (the code is within the message handler for the
>button):

> CAddressDlg Dlg(this);
> ....
> ....
> Dlg.DoModal();

>When the code gets to DoModal(), it fails; after debugging, it seems
>that the SetWindowText() function fails on assertion because for some
>reason the window doesn't get created, as it would normally when you
>call DoModal().

>Any help is appreciated. Thanks.
>Mohsen



Tue, 07 Aug 2001 03:00:00 GMT  
 Displaying a modal dialog from within a property sheet/page
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)...


Quote:
>Make sure you have the 'visible' attribute set for the dialog resource.
>Additionally, you can try removing the (this) argument when you instantiate
>the dialog.



>>Hi,

>>I'm using Visual C++ 5.0 and MFC. I have a property sheet with several
>>property pages, and I want to be able to display a modal dialog box as
>>a child to one of these property pages (i.e. by pressing a button, on
>>the property page).

>>I've tried the normal way of displaying a modal dialog box, and the
>>code is as follows (the code is within the message handler for the
>>button):

>> CAddressDlg Dlg(this);
>> ....
>> ....
>> Dlg.DoModal();

>>When the code gets to DoModal(), it fails; after debugging, it seems
>>that the SetWindowText() function fails on assertion because for some
>>reason the window doesn't get created, as it would normally when you
>>call DoModal().

>>Any help is appreciated. Thanks.
>>Mohsen



Sat, 11 Aug 2001 03:00:00 GMT  
 
 [ 5 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