Solved

Displaying child dialogs from within a propertypage

Posted on 1997-11-19
4
257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

726 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