Solved

Creating static splitter windows "dynamically"

Posted on 1997-05-30
4
327 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
4 Comments
 
LVL 4

Expert Comment

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

Author Comment

by:bpearson
Comment Utility
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 200 total points
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now