tags:

views:

635

answers:

1

hi, I am trying to use the OpcRcw.da.dll; If I interop this dll inside a test console project everything works. But if I build dll project to do my interop gymnastic and ref my library into my console project I am getting this error.

COM object that has been separated from its underlying RCW cannot be used.

What need to be done to a class lib project to not kill the RCW ref....

thanks

A: 

It's somewhat hard to tell what your actual application is doing, but it sounds like you may be instantiating the COM object and then attempting to access it from another thread, perhaps in a Timer.Elapsed event. If your application is multithreaded, you need to instantiate the COM object within each thread you will be using it in.

AJ
I found it out I have a Com event wich use a IConnectionPoint and IConnectionPointContainer and I was releasing the IConnectionPointContainer.that was the error thanks
kevin marchand
OK cool. Make sure you post your answer and mark it as the accepted answer for anyone who has this problem in the future.
AJ