Message 1 of 7
Nested document objects
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Why would nesting
{code}
Document doc = Application.DocumentManager.MdiActiveDocument;
{code}
affect each other? I have a plotting routine that creates its own document object. In that routine I call another routine that inserts a block. In that second routine I create another document object as above. Also in that routine, I use the using (doc) command. However, when it leaves that routine, the first doc becomes null and it throws an exception. Shouldn't those two separately created doc objects be, well, separate entities?
Would it be better to pass the document object from the first routine to the routine(s) it calls?
This all started because I was trying to remove all my objects and not wait for the garbage collection.
Patrick
{code}
Document doc = Application.DocumentManager.MdiActiveDocument;
{code}
affect each other? I have a plotting routine that creates its own document object. In that routine I call another routine that inserts a block. In that second routine I create another document object as above. Also in that routine, I use the using (doc) command. However, when it leaves that routine, the first doc becomes null and it throws an exception. Shouldn't those two separately created doc objects be, well, separate entities?
Would it be better to pass the document object from the first routine to the routine(s) it calls?
This all started because I was trying to remove all my objects and not wait for the garbage collection.
Patrick