Solved

Creating static splitter windows "dynamically"

Posted on 1997-05-30
4
381 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 200 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

Industry Leaders: 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!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

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