Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

CSplitterWnd question

Posted on 1997-12-11
7
Medium Priority
?
477 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
  • 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 800 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

580 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