Solved

MDI operation on remaining child after on child closed?

Posted on 2002-03-22
8
185 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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: 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…
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now