Solved

Displaying child dialogs from within a propertypage

Posted on 1997-11-19
4
249 Views
Last Modified: 2013-11-20
I have created a dialog based application that contains a property sheet. The sheet contains one property page. When I try to display a CFileDialog or call AfxMessageBox when a button is pressed on the page, the entire application locks up - the busy cursor appears and the interface stops refreshing. If I do not make the property sheet a child of the dialog, it works. Why can I not display CDialog derived child windows from within a property page?
0
Comment
Question by:JamieR
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1310265
There shouldn't be any problems with it because I do that myself. What styles do you have for the dialog? Make sure you don't have WS_CHILD or something like that. The styles I'm using for my dialogs are DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU.

0
 
LVL 1

Author Comment

by:JamieR
ID: 1310266
I'm using the same dialog styles here. The only solution I can find is to lose the dialog and use the property sheet directly modally (using the DoModal call). This isn't really what I want to do.


0
 
LVL 1

Accepted Solution

by:
dkremer earned 40 total points
ID: 1310267
Hi
Derive CPropertySheet like this :

/*
** Header file
*/

class CModlessPropertySheet : public CPropertySheet
{
      DECLARE_DYNAMIC(CModlessPropertySheet)
public:
      CModlessPropertySheet();

      virtual BOOL OnInitDialog();
};

/*
** Implementation
*/

IMPLEMENT_DYNAMIC(CModlessPropertySheet, CPropertySheet)

CModlessPropertySheet::CModlessPropertySheet() : CPropertySheet()
{
}

BOOL CModlessPropertySheet::OnInitDialog()
{
      ModifyStyleEx (0, WS_EX_CONTROLPARENT);

      return CPropertySheet::OnInitDialog();
}
   
/* -------------------------------------------------------------------------------------------*/

That's it, it's a known bug in CPropertySheet...

   Bye,
    - Dror Kremer

0
 
LVL 1

Author Comment

by:JamieR
ID: 1310268
Wow! That's it - thank you.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now