I think that makes sense (sort of).
If I put the code to close the connection in the Dispose method (which is
called before the object goes out of scope) everything works fine. My
interpretation is that the destructor will not get called until the object is
garbage collected (which occurs long after the object goes out of scope from
my observation). Is this kind of what you are talking about?
By the way, I hope this doesn't sound like to silly of a question but what
is the RCW and what is its purpose in life (I am assuming it is some sort of
a bridge between .NET and COM).
Thank you,
Jason Richmeier
""Peter Huang" [MSFT]" wrote:
Hi
From your description you are trying to call a COM object from .NET. The
calling route is as below.
.NET--->RCW--->COM.
From the error, it seems that you are trying to calling the method of
closeconnection, but at that time the RCW have release all the COM
reference to the COM. So the .NET can not access the COM via RCW which
cause the problem.
I suggest you try to call the closeconnection at a earlier time.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.