Solved

Creating static splitter windows "dynamically"

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Smart Camera scanning and reading information 3 106
countEvens challenge 2 103
twoTwo  challenge 35 103
mapBully challenge 6 136
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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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 tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

803 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