Hello!
I have a non-.NET application that uses COM components as plug-ins. But
when I use .NET (through interop services), a problem with releasing
resources occurs.
The application was designed to work with ordinary COM objects, so
disconnection from application is discovered by "checking" reference
count, and when it reaches 0, destructor is called.
But when plug-ins are written in .NET and exposed through interop,
neither IDisposable.Dispose() nor destructor is called - even if
application is closed!
Currently I see 3 solutions for this, but have no idea how to do this:
1) somehow override AddRef/Release or get event when such method is
called
2) generate CCW source code and modify it a bit to call
IDisposable.Dispose() method
3) force .NET to run GC on object that has refcount=0
If someone knows how to do this, or has ony other idea how to solve this
problem, please HELP
Marek Budyn
ra**@infostrade.com.pl
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!