Re: visio internal error 2123
- From: "Mark Nelson [MS]" <marknel@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 12 Dec 2005 20:56:53 -0800
Thanks for the additional information. At this point I don't have any
further suggestions. The most common issue here is that a program tries to
tell Visio to modify the drawing while in an undo scope.
--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"VM" <VM@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2FEDB8A2-D384-4BAA-92F7-E4EFF4103CF6@xxxxxxxxxxxxxxxx
> This is some addition to your simplification of scenario below. We ALSO
> add
> shapes programatically during the events like visevtconnect and also
> delete
> some shapes that were dropped earlier in the similiar fashion.The Undo
> unit
> observed in the Edit box just before selecting all the shapes "undo size
> object". The undo unit observed in the Edit box just after deleting all
> the
> shapes selected is "undo set formula".
> Now we do CNTRL+Z.
>
>
> "Mark Nelson [MS]" wrote:
>
>> By unit I mean something that implements the IVBUndoUnit interface, which
>> allows programs to add their own items to Visio's undo queue.
>>
>> Here is my simplification of the scenario below. When the user drops
>> shapes
>> on the page, you programmatically drop additional shapes. When the user
>> deletes shapes from the page, you programmatically delete the shapes you
>> added. You also want to handle undo properly.
>>
>> If this is all you are doing, there is no need to create undo units and
>> add
>> them to Visio. Any change you make to the Visio drawing is automatically
>> folded into the existing undo unit. When the user drops a shape, Visio
>> begins an undo scope for that action and then fires events to notify you
>> about the action. You handle the event and tell Visio to drop another
>> shape. Because Visio is in the middle of an existing scope, your changes
>> are recorded in the existing undo unit. Once everyone has been notified
>> of
>> the events and responded, the undo scope is closed and the undo unit is
>> placed in the Undo queue. If the user chooses Undo, your changes are
>> reversed and then the user's changes.
>>
>> It is important to understand that Visio will fire events in response to
>> changes you make to the document. If you handle ShapeAdded and
>> programmatically add another shape, you will get a second ShapeAdded
>> event
>> that you need to properly ignore. It is also important to understand
>> that
>> Visio will fire events during Undo and Redo. If the user undo's a shape
>> add, you will get the BeforeShapeDelete event. You should not make ANY
>> changes to the Visio document during undo or redo. Visio already knows
>> what
>> changes to make. The events are fired so that you can update any
>> information you are managing outside the Visio drawing.
>>
>> If after reading this, you think your scenario really does require
>> creating
>> your own undo units, post again with more information about your
>> scenario.
>>
>> --
>> Mark Nelson
>> Office Graphics - Visio
>> Microsoft Corporation
>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "VM" <VM@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:F92014A8-D9D3-4BCC-B34C-E7D92FCA63DF@xxxxxxxxxxxxxxxx
>> >
>> > Hi,
>> > Could you please signify what does the term "units" mean. Does it mean
>> > any
>> > thing related to z-order.
>> > We are programmatically creating undo units. I need a clarification
>> > here.
>> > Say I have pushed an UNDO unit which encompasses parallel information,
>> > an
>> > application object which is our own object. Does Visio also push an
>> > undo
>> > unit
>> > parallely which encompasses information about the state of Visio
>> > application.
>> > I have got some recent observations on the problem. Please see if they
>> > can
>> > get you some more idea about the problem.
>> > 1) We have different kinds of shapes like switches, cables, fabrics.
>> > Now
>> > when a user drops a switch from stencil we programmatically drop a
>> > shape
>> > called fabric. Basically all the switches connected by cables is called
>> > fabric. This fabric shape by default design is lock shaped. There fore
>> > when a
>> > user selects all the switches and cables by CNTRL+A he can not select
>> > this
>> > fabric. Say a user has done CNTRL+A and selects all the switches and
>> > cables.
>> > Now he deletes them. We then delete this fabric shape programmatically.
>> > Now I
>> > say CNTRL+Z I am getting the problem. So WHAT I HAVE DONE IS I have
>> > made
>> > the
>> > fabrics explicitly selected by users along with switches and cables and
>> > delete them simultaneously instead of deleting the fabrics separately
>> > thru
>> > programme. Then there is no BUG. But unfortunately we can not allow a
>> > user
>> > to
>> > explicitly select the fabric shape.
>> > 2) Another observation: when I am dropping cables I am pusing them
>> > using
>> > sendtobackward thrice. The other shapes, after being dropped, I am
>> > doing
>> > bringforward thrice. Then no BUG comes. But any slightly different way
>> > of
>> > pushing shapes is not working. We could not accept this solution for we
>> > do
>> > not understand the reason explicitly.
>> >
>> > Any slight help will be greatly appreciated.
>> >
>> > "Mark Nelson [MS]" wrote:
>> >
>> >> I believe that the knowledge base article specifically applies to
>> >> Process
>> >> Engineering diagrams, so the information may not be applicable to your
>> >> situation.
>> >>
>> >> It's not clear from your explanation whether you are programmatically
>> >> creating Visio undo units and/or manipulating the Visio diagram in
>> >> response
>> >> to undo or redo. Make sure that your code does not modify the Visio
>> >> diagram
>> >> during undo or redo. You should be checking for this state whenever
>> >> you
>> >> handle an event from Visio.
>> >>
>> >> --
>> >> Mark Nelson
>> >> Office Graphics - Visio
>> >> Microsoft Corporation
>> >>
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights.
>> >>
>> >> "VM" <VM@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:74923E98-99F4-49B3-83C3-5C9F15A82907@xxxxxxxxxxxxxxxx
>> >> > Hi,
>> >> > I am struck up with the following problem in visio. I am getting the
>> >> > following error Visio Internal Error #2123 in one scenario. I want
>> >> > some
>> >> > explanation for the cause and resolution suggested online in the
>> >> > context
>> >> > of
>> >> > our scenario.
>> >> >
>> >> > We have an Addon written for Microsoft Visio. We have two kinds of
>> >> > shapes,
>> >> > switches and diskarrays. Both are grouped visio shapes.
>> >> > We are handling the undo and redo mechanism according to the
>> >> > Microsoft
>> >> > visio
>> >> > documentation.
>> >> >
>> >> > I have dropped three switches which are connected by cables (another
>> >> > kind
>> >> > of
>> >> > shape).now I select them all together and delete them. Now I do
>> >> > cntrl+z
>> >> > to
>> >> > retrieve them back. But I what I get is visio error. If I group them
>> >> > all
>> >> > and
>> >> > repeat the scenario I do not get the error.
>> >> >
>> >> > The cause of the error as it is mentioned at
>> >> > http://support.microsoft.com/default.aspx?scid=kb;en-us;294104 is
>> >> > that
>> >> > the
>> >> > shapes are with in three units of another visio shape. I do not
>> >> > understand
>> >> > the term unit. I am not able to take the meaning of the term unit
>> >> > to
>> >> > be
>> >> > distance because of the following case. In the above diagram if i
>> >> > replace
>> >> > any
>> >> > one of the switch shape by a diskarray shape then I am not getting
>> >> > any
>> >> > error.
>> >> > Also the context given in the site where the error is supposed to
>> >> > come
>> >> > is
>> >> > different to the context where the error is coming for me. There
>> >> > some
>> >> > shapes
>> >> > are drawn and they are deleted using UNDO command (cntrl+z option)
>> >> > whereas
>> >> > I,
>> >> > here, have drawn the above said combination,
>> >> > then deleted them normally, then tried to retrieve them by using
>> >> > cntrl+z.Therefore I do not understand how the resolution suggested
>> >> > "delete
>> >> > the most recently placed shape instead of using the Undo command" is
>> >> > helpful
>> >> > to me."
>> >> >
>> >> > Could any one clear me on the cause and resolution of the above
>> >> > error
>> >> > in
>> >> > the
>> >> > context cited above.
>> >> > The version of the visio I am using is Visio profesional
>> >> > 2003(11.3216.6360).
>> >> >
>> >>
>> >>
>> >>
>>
>>
>>
.
- Follow-Ups:
- Re: visio internal error 2123
- From: VM
- Re: visio internal error 2123
- References:
- Re: visio internal error 2123
- From: Mark Nelson [MS]
- Re: visio internal error 2123
- From: VM
- Re: visio internal error 2123
- From: Mark Nelson [MS]
- Re: visio internal error 2123
- From: VM
- Re: visio internal error 2123
- Prev by Date: Re: cannot obtain events after doc.close
- Next by Date: FlowChart
- Previous by thread: Re: visio internal error 2123
- Next by thread: Re: visio internal error 2123
- Index(es):
Relevant Pages
|