?
Solved

Displaying child dialogs from within a propertypage

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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 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