?
Solved

Creating static splitter windows "dynamically"

Posted on 1997-05-30
4
Medium Priority
?
397 Views
Last Modified: 2013-11-20
Hi,
    Is it OK to create static splitter windows (i.e. with an object of CSplitterWnd and it's CreateStatic function) at various points within the life of an application or should it be done in the frame windows OnCreateClient function call only (as does all of the MFC sample code I have found)?!?  I would like the user to be able to interactively add/remove views (and thus splitter window panes) to an existing MDI
child frame window.  I have a preliminary test app that seems to work OK.  This app embeds additional CSplitterWnd objects within existing CSplitterWnd objects (by specifying the existing CSplitterWnd object as the parent of the new CSplitterWnd object similar to the VIEWX example) at times other than within the frame windows OnCreateClient function.
Has anyone else created "dynamic" static splitter windows and, if so, are there inherent problems in doing so?

Thanks in advance,

Brian Peasron
Vivid Technologies

0
Comment
Question by:bpearson
[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 Comments
 
LVL 4

Expert Comment

by:AVaulin
ID: 1301896
See SAMPLES\MFC\TUTORIAL\SCRIBBLE example how to create dynamic CSplitterWnd.
0
 

Author Comment

by:bpearson
ID: 1301897
Like I said, all the MFC samples I have found (including Scribble with it's dynamic splitters (I need STATIC!)) create the splitter windows in the frame windows OnCreateClient.  What I need to know is can splitter window creation be safely done elsewhere at various times within the life of the application?
0
 
LVL 4

Accepted Solution

by:
mbhakta earned 400 total points
ID: 1301898
Wish life was easier. But there are some short-comings or rather prerequisite requirements for Splitter windows such as the CCreateContext parameter in most of its creation calls which can be only supplied by OnCreateClient. In one of my projects I tried doing the same you are planning to achieve. Off course I didn't work hard on it and finally agreed on making my splitter bar visible/invisible for particular views. Infact I had about 6 view swapping over one another on a SDI document and 2 splitters were made visible and invisble at various instances. I suggest doing this instead of hacking through the MFC maze and not achieving much. Follow the tide!!!
0
 
LVL 2

Expert Comment

by:The Master
ID: 1301899
A friend of mine and I did exactly what you are attempting.  Actually, he started it and I finished it.  It is possible - the hardest part is keeping track of what's beed created and then unwinding them in the correct order so you don't leak memory.  Email me if you'd like more information... bill@lith.com
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

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…
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…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

770 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