Solved

CSplitterWnd question

Posted on 1997-12-11
7
460 Views
Last Modified: 2013-11-20
I've got several splitters in different MDI child windows. When the main frame receive WM_CLOSE, I want to save the position of the splitters. I call CSplitterWnd::GetRowInfo to get the current position. That works alright for the active MDI child window, but not the rest. There I get the approx same value whatever the real position is.
Why is that, and how do I fix it?
0
Comment
Question by:rj2
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 1

Expert Comment

by:MarkusLoibl
ID: 1312143
I have a solution for you, but its too big to sourcecode it here.
Tell me your email and I'll send you!
MLoibl@moss.de
0
 
LVL 1

Expert Comment

by:MarkusLoibl
ID: 1312144
In my solution there is a mechanism to save/reset the pane-positions. I do not use MDIchilds, but use my own abstration of how to describe splitted panes. It's flexible, because one is not limited by any number of panes and can be changed dynamically (its done so e.g. when you restart the program). I cannot and do not want to give you the class-library you are looking for, thats your task. You just asked how to do it. You can do it my way (in my splitter-classes you can retrieve the sizes, because they are stored in the registry).
If you are not happy with it, just reject it, that's noproblem for me.
0
 
LVL 10

Author Comment

by:rj2
ID: 1312145
I asked how to get the correct splitter position from a splitter in non-active mdi child window. The source is probably great, but it don't answer that. I'm neither looking for nor expecting a class library. I just want information on how to solve this particular problem.

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 3

Accepted Solution

by:
altena earned 200 total points
ID: 1312146
The easiest approach is to remember the splitter position
when a MDI object gets deactivated.

All you have to do when the application is closed is to enumerate over your MDI-children and write these
positions to the registry.

Good Luck.
0
 
LVL 10

Author Comment

by:rj2
ID: 1312147
You mean call CSplitterWnd::GetRowInfo and buffer the value in a WM_MDIACTIVATE handler?
You say that's the easiest approach, I'm just curious: what other approaches are there?
Do you know why CSplitterWnd::GetRowInfo gives incorrect results when the mdi child isn't active?
0
 
LVL 3

Expert Comment

by:altena
ID: 1312148
Even simpler:
Call CSplitterWnd::GetRowInfo and buffer the value in a
WM_ACTIVATE handler.
The window to be deactivated will get a
fActive == WA_INACTIVE parameter

I think the above solution is a good one. The best would be
to get CSplitterWnd::GetRowInfo working. (suprise)

However, out of principle, I do not study MFC internals,
Just like you my job is to build software. If I have to learn
the internals of a class library in order to use it, then
thanks, but I will use the Win32 API with straight C/C++.

So when problems (like your question) pop up my first instinct
is to look for another way to archieve the desired result.

  Happy Hollidays



0
 
LVL 10

Author Comment

by:rj2
ID: 1312149
Thanks. Happy holidays to you too.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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 …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

691 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