PDA

View Full Version : Can't Save Drawing



bweir
2007-11-01, 02:34 PM
I've created a command in VB.Net it appears to work fine but after I've run the command I can not save the drawing. Every time I try to save (autosave also) I get this little message (see attached), "Error writing/closing file.".

Any body have any ideas on this? I'm assuming I have something like a transaction that is still active and wont let the file be saved. Am I on the right track?

Thanks

Opie
2007-11-01, 02:36 PM
I've created a command in VB.Net it appears to work fine but after I've run the command I can not save the drawing. Every time I try to save (autosave also) I get this little message (see attached), "Error writing/closing file.".

Any body have any ideas on this? I'm assuming I have something like a transaction that is still active and wont let the file be saved. Am I on the right track?

Thanks
That sounds right, but I wouldn't know where to point you to.

bweir
2007-11-01, 03:58 PM
Well I don't think it's a Transaction after all. Checking the NumberOfActiveTransactions property of the TransactionManager has reveled that there are 0 transactions. I'm looking into the parts of the program that handle Extension Dictionaries, think that a Dictionary could still be open with the transaction closed?

I'll keep you posted to what I discover.

bweir
2007-11-01, 05:00 PM
I found the problem :)

What happened was I have an XRecord that is added to a Dictionary. I missed have a line of code, added XRecord.Dispose and now everything is great!

Like csharpbird says, "Do not rely on .NET garbage collection to free the memory used by unmanaged resources.".:beer: