.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error Handler Re-Entered

3 REPLIES 3
Reply
Message 1 of 4
BillZndl
872 Views, 3 Replies

Error Handler Re-Entered

Acad 2006 net2.0 sp2 VS2005

How do I catch an error like this?

I have a modeless dialog that displays a list of groups in a drawing.
It has event handlers for document created and document activated
and event handlers for database append and database unappend.

Everything works good and all my method are in try catch blocks.
But,
I can start in a drawing in autocad that contains our groups
and use the autocad copy command to copy a group,
as soon as I try to undo the copied group,
I receive this message and autocad closes.
Even if i haven't done anything else in the drawing prior to the copy and undo.

Is there a "top ten reasons" for this to happen?
I'd like a "global error trap" to give me an idea of what is happening or what to look for?
I can post the code but it is getting to be a large amount of code/classes.

thanks

Bill
3 REPLIES 3
Message 2 of 4
BillZndl
in reply to: BillZndl

I have it narrowed down to the Database_ObjectUnappended event.

For some reason,
I can copy the group with my net deepcloneObjects and undo that without problems,
but if I copy the group with the autocad command, then undo, it crashes.

I'll have to look at it some more.

Bill
Message 3 of 4
Anonymous
in reply to: BillZndl

Some events that fire when objects are modified are also fire when the
changes are undone. In most cases, you check the IsUndoing property of the
notifying object, and do nothing if it it's true.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6250759@discussion.autodesk.com...
I have it narrowed down to the Database_ObjectUnappended event.

For some reason,
I can copy the group with my net deepcloneObjects and undo that without
problems,
but if I copy the group with the autocad command, then undo, it crashes.

I'll have to look at it some more.

Bill
Message 4 of 4
BillZndl
in reply to: BillZndl

>In most cases, you check the IsUndoing property of the
>notifying object, and do nothing if it it's true.

Thanks.
I also found out that you can't do anything on the object that's firing the event,
as it appears to be open for modifications by the database at that time.

Turns out, I have a global module that contains a hashlist I use for keeping track of the group names when added to the database,
that way I can use the items in the hashlist to edit the fields after the database is done with them.
The AutoCAD copy command wasn't listing the anonymous groups like my net copy was,
so it was thowing things out of sync.
I didn't it would throw that kind of error being I was using a try/catch but it did.

Thanks again

Bill

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost