?
Solved

Displaying child dialogs from within a propertypage

Posted on 1997-11-19
4
Medium Priority
?
262 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 160 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

862 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