Link to home
Start Free TrialLog in
Avatar of Surfer
Surfer

asked on

MDI operation on remaining child after on child closed?

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.
Avatar of Roshan Davis
Roshan Davis
Flag of United States of America image

Check IsWindow(hWnd) before reposition

GOOD LUCK
Avatar of Surfer
Surfer

ASKER

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?
Avatar of Surfer

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of Roshan Davis
Roshan Davis
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Surfer

ASKER

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?
Try This

this is working , not to check IsWindow()

Add this code in ur CChildFrame Destructor

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

GOOD LUCK
Avatar of Surfer

ASKER

That did the trick!
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