Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPTaskDialog ignoring parent
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTaskDialog ignoring parent

 Post Reply Post Reply
Author
Message
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTaskDialog ignoring parent
    Posted: 09 February 2008 at 4:05pm
Hi
 
I've got an app that uses a number of frame windows, each with views in them.  One for the main part of the app, and others that are spawned to edit specific content.
 
Whenever a user closes an edit frame, without saving changes, I post a CXTPTaskDialog-derived dialog to warn them about the changes.  I set the parent to be the sub-frame, however it always brings that main frame of the app to the front before displaying the dialog, so the frame the user was working in is immediately covered.
 
Using spy++ you can see the parent window for the dialog is the desktop, not the window I specified.  The dialog centers itself on the parent, but is not a child of the parent.
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2008 at 4:11pm
more on this.  this is on XP, so no built-in task dialog.
 
Inside CXTPTaskDialogFrame::DoModal(), it calls
 
InitModalIndirect(m_lpDlgTemplate);
 
this is a CDialog call, it should be passing the parent window pointer in here as well.
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2008 at 4:15pm
looks like there will need to be a m_pParentWnd member added to CXTPTaskDialogFrame to store the pointer from the constructor to be used in DoModal.
 
Create allows you to pass in a parent, but I need this dialog to be modal.
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 09 February 2008 at 4:20pm
ignore that last one about adding the member.  It derives from CDIalog already.
 
I worked around it by setting
 
m_pParentWnd = pParentWnd
 
in the constructor of my derived class.  However, the constructor of the CXTPTaskDialogFrame (and parents) should be modified to allow passing the parent pointer up the constructor chain.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 February 2008 at 8:36am
Thanks, we added m_pParentWnd = pParentWnd line.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.