Custom UndoUnits in C#

A

aerostar33

Trying to implement a custom undo unit for an C# application using the Visio 2003 ActiveX Drawing Control. Found the VB undo unit code in Developing Visio Solutions and converted this to C#. I am instancing new Undo units on the ShapeAdded event. When I run and perform an Undo of a shape added, my callback method gets called and the undo of my custom data is performed but the shape is not removed and Visio throws up this message

"Visio internal error: #340
Action 1017: Und

First try closing and reopening the file. Next try restarting Visio.

Anybody know what is causing this?
 
K

Kevin Griffie

I have the same problem. I am trying to use UndoUnits in C#. I get
the 3400 error when the Do method of my undo unit gets called. If the
Do method just displays a message box, I don't get the error. If the
Do method does more complex work, I get the error. I have not
determined if the error is occuring because the Do method code is
playing with Visio objects, but I would assume that is causing the
problem. It would be great to get MS feedback on this issue.
UndoUnits do not seem to be well documented.
 
K

Kevin Griffie

I had the same error from a C#-based Visio Add-on. In the Do method
of my UndoUnit object, I was generating an unhandled exception.
Fixing the code that was generating the exception, solved my problem.
 
A

aerostar33

My callback method for the Undo was generating an exception that I did not catch. This was causing the #3400 error. Everything appears to be working now. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top