Triggering Addon w/ EventXFMod triggers multiple times 
Author Message
 Triggering Addon w/ EventXFMod triggers multiple times

Hello all!

I have been fighting with a particular problem for the
last week, and thought it was about time to try the on-
line expert base!

I have an application that uses an addon to control Visio
2000 with automation. When the user moves one of the
shapes, it calls my application, which may or may not in
turn move the shape again. What I am encountering is that
the EventXFMod cell is being evaluated over and over, and
I have not found any way of ignoring subsequent "events".

MS have a doc in the MSDN which outlines a similar issue,
called "Preventing Multiple Undo/Redo Units When
Triggering an Add-On from EventXFMod Cell in Visio 2002",
but it does have a disclaimer that it won't work with 2000
due to a bug in one of the properties. Since I don't care
about that property (IsUndoingOrRedoing), I tried
implementing the solution. Either it simply won't work, or
I coded it incorrectly.

To make things that much more difficult, if I step through
the code, it works. This only happens when the code simply
executes.

Any assistance would be greatly appreciated!

TIA!

Mike Andrews
Senior Application Developer
Kanotech Info. Sys. Ltd.



Fri, 11 Mar 2005 20:11:26 GMT  
 Triggering Addon w/ EventXFMod triggers multiple times
Mike,

You won't trap this by debugging because the natural pause while stepping
through code is enough to change the execution timing.  The typical fix for
this is to set a flag in the shapesheet as soon as your code is called.
Then clear the flag when your code completes.  Meanwhile change your trigger
to only fire if the flag is clear.

--
Mark Nelson
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:
> Hello all!

> I have been fighting with a particular problem for the
> last week, and thought it was about time to try the on-
> line expert base!

> I have an application that uses an addon to control Visio
> 2000 with automation. When the user moves one of the
> shapes, it calls my application, which may or may not in
> turn move the shape again. What I am encountering is that
> the EventXFMod cell is being evaluated over and over, and
> I have not found any way of ignoring subsequent "events".

> MS have a doc in the MSDN which outlines a similar issue,
> called "Preventing Multiple Undo/Redo Units When
> Triggering an Add-On from EventXFMod Cell in Visio 2002",
> but it does have a disclaimer that it won't work with 2000
> due to a bug in one of the properties. Since I don't care
> about that property (IsUndoingOrRedoing), I tried
> implementing the solution. Either it simply won't work, or
> I coded it incorrectly.

> To make things that much more difficult, if I step through
> the code, it works. This only happens when the code simply
> executes.

> Any assistance would be greatly appreciated!

> TIA!

> Mike Andrews
> Senior Application Developer
> Kanotech Info. Sys. Ltd.



Sun, 13 Mar 2005 00:14:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Trigger-Happy Triggers

2. multiple triggering of events(spikes or what) jinu

3. multiple triggering of events(spikes or what) jinu

4. Time Triggered Procedures

5. Time Trigger Procedure

6. accessing SENDERNAME triggers security message each time

7. BeforeUpdate trigger two times.

8. How to add triggers to run-time controls

9. Event triggered by index

10. Event Trigger

11. On Open Trigger

12. Form Events not triggered

 

 
Powered by phpBB® Forum Software