Re: How to switch the document within CMultiDocTemplate instance?

Tech-Archive recommends: Fix windows errors by optimizing your registry



This seems very odd.

First, it sounds like you are using a CFormView. In that case, "replacing" the controls
consists of simply enabling/disabling or showing/hiding some controls.

Switching the document out from under the running view seems a bizarre thing to want to
do. Switching the template so future documents may be created differently is already a bit
strange, but perhaps it makes sense. But switching the actual document representation
underneat a view is an invitation to disaster. I don't even want to THINK about what
happens with virtual methods in this case, but It Will Not Be A Pretty Sight.

You really need to explain a lot more clearly what you want to accomplish. You are
probably approaching the problem from the wrong viewpoint. The safe thing to assume is
that you do NOT want to change the document type of an actual document, and from your
description it sounds more like you are wanting to change the view.

You probably have a simple problem which you are making a hard problem, but this
explanation is not much more enlightening.But since you say you are new at this, my
suspicion is that this is almost certainly the wrong approach for whatever you are trying
to accomlish.
joe

On 2 Jul 2005 05:30:08 -0700, "Rachel" <herachel@xxxxxxxxxxxx> wrote:

>Thanks for your reply!
>I want to keep the child frame and views open but point them to a
>different document (As you wrote clearly :-)
>
>The MDI application uses the instances of CmultiDocTemplate and switch
>between them (Today there is a real performance issue when performing
>the switching).
>For each instance there is one child frame, one document and several
>views.
>But part of the frames has many similar controls/forms.
>
>I wish I could change at run time the document (it's already
>implemented), to keep the original frame and to replace some controls
>that are not common.
>
>Please forgive me if I am not clear. I am new to the doc/view
>architecture.

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.


Quantcast