|
-
Aug 22nd, 2007, 10:01 PM
#1
Thread Starter
Lively Member
[2005] Assembly Threading Apartments
Hi Guys,
I am creating a class to wrap some Excel functionality. My class exposes the IDisposable interface in order to kill Excel once I have finished with it. When I explicitly call my Dispose() method everything is fine. If I leave it up to the framework I get error: "COM object that has been separated from its underlying RCW cannot be used."
When I call Dispose() from my WindowsForms project its is in STA mode; everything is fine. If the framework calls Dispose() the threading state is MTA.
How would I go about ensuring the framework calls Dispose() on the same thread as it was created?
Thanks Guys,
Matt
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|