Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CSplitterWnd question

Posted on 1997-12-11
7
Medium Priority
?
474 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
Technology Partners: 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

618 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