Re: EnumChildWindows
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Sun, 28 Oct 2007 18:18:10 -0500
See below...
On Sun, 28 Oct 2007 08:08:00 -0700, Al <Al@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Good Moring****
It is really not a error, the program compiles and runs with no obvious
error except for when I hit a selection from the main menu to change the
right view, it stays the same. As I said earlier, I followed the code and the
<code>
context.m_pNewViewClass=pViewClass;
<code>
is being passed the correct RUNTIMECLASS but it doesn't change the right
view. Is there something I am missing?
Changing a pointer doesn't change the fundamental structures used in the operating system,
so you have to change those structures also, such as showing one view and hiding the
other. Pointers are just pointers, and the real representations are buried deep in the
OS. Changing pointers without telling Windows you've done something like this merely
results in ASSERT failures of various sorts when the wrong pointer seems to be set. Since
I've never tried to switch views in a splitter, I haven't examined all the issues, but I
can tell you that switching pointers is not going to do anything particularly interesting.
****
****
Next - I read a previous thread from you Joseph and let me see if this is
correct. In an explorer style application, you would use the left view to
change the view on the right, selections being done from the main menu and
the left view itself, with a tree control by sending messages to the main
frame correct?
I will do it one of two ways, depending on the nature of the problem. When I have
multiple views on a single document, I'm more likely to keep the state in the document and
use UpdateAllViews with nonzero lHint and non-NULL pHint to pass information across the
view boundaries. When I have multiple independent windows working on global device state,
I'm more likely to PostMessage or SendMessage to the main frame, then use
SendToDescendants to forward the message to all child windows. My taste in this has
varied over time, but in the case of multiple views on a single document, I now favor more
strongly the CDocument::UpdateAllViews approach.
joe
****
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Re: EnumChildWindows
- From: Al
- Re: EnumChildWindows
- From: Joseph M . Newcomer
- Re: EnumChildWindows
- From: Joseph M . Newcomer
- Re: EnumChildWindows
- From: Al
- Re: EnumChildWindows
- From: Scott McPhillips [MVP]
- Re: EnumChildWindows
- From: Al
- Re: EnumChildWindows
- From: Joseph M . Newcomer
- Re: EnumChildWindows
- From: Al
- Re: EnumChildWindows
- Prev by Date: Re: handling control notifications in different window than parent
- Next by Date: Re: EnumChildWindows
- Previous by thread: Re: EnumChildWindows
- Next by thread: Re: EnumChildWindows
- Index(es):
Relevant Pages
|