Solved

Displaying child dialogs from within a propertypage

Posted on 1997-11-19
4
256 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Replacement selected text 2 69
Expand to include initial dialog with two choices. 9 93
VBA "SendKeys" Syntax for Multiple Keystrokes 7 133
Annoying "thing" blocks my view 4 143
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

740 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