Solved

MDI operation on remaining child after on child closed?

Posted on 2002-03-22
8
191 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
Three Considerations for Containers

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read our article on Experts Exchange.

 
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

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!

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

631 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