Solved

MDI operation on remaining child after on child closed?

Posted on 2002-03-22
8
189 Views
Last Modified: 2013-11-20
I have a MDI app.  If I have 3 or more child windows open at a time, and a close one off the 3 open windows, I want the remaining windows to automatically retile.  A have a custom tile function in my CMainFrame and need to call it to reposition the remaining child windows.  If I call this from the child I am closing, I get an ASSERTION because the child the calls reposition, is destroyed.  I need to call this reposition AFTER the client is destroyed.  I imagine I do this from CMainFrame but can not figure it out.  All suggestions welcome and code samples greatly appreciated.
0
Comment
Question by:Surfer
[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
  • 4
  • 3
8 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6888250
Check IsWindow(hWnd) before reposition

GOOD LUCK
0
 

Author Comment

by:Surfer
ID: 6888262
How do I know when to check IsWindow()against my reposition, from CMainFrame?  Is there a member in CMainFrame that is called AFTER the Child is destroyed?
0
 

Author Comment

by:Surfer
ID: 6888266
How do I know when to check IsWindow()against my reposition, from CMainFrame?  Is there a member in CMainFrame that is called AFTER the Child is destroyed?
0
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!

 
LVL 23

Accepted Solution

by:
Roshan Davis earned 200 total points
ID: 6888278
Add this code in ur CChildFrame Destructor

((CMDIFrameWnd*)AfxGetMainWnd())->MDITile(MDITILE_VERTICAL);

GOOD LUCK

0
 

Author Comment

by:Surfer
ID: 6888280
How do I know when to check IsWindow()against my reposition, from CMainFrame?  Is there a member in CMainFrame that is called AFTER the Child is destroyed?
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 6888281
Try This

this is working , not to check IsWindow()

Add this code in ur CChildFrame Destructor

((CMDIFrameWnd*)AfxGetMainWnd())->MDITile(MDITILE_VERTICAL);

GOOD LUCK
0
 

Author Comment

by:Surfer
ID: 6888284
That did the trick!
0
 
LVL 8

Expert Comment

by:VinExpert
ID: 6888298
Hi,

Can U just post the code of how u r calling ur tile window function from child window? And if possible post the custom tile function also, so that we can get wher exactly it is crashing.

VinExpert
0

Featured Post

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 172
ASCII Non-Printable characters/codes and their HTML equivalents 6 159
string initialization in java 11 122
MaxSpan challenge 9 140
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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