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

R

Rahul T.

Hello All,

I am trying to create a web service. This web service for
now, has to use couple of exisiting COM components. I
have added them in my .NET project as COM interop. Most
of the time it works great. But randomly we get an error

"COM object that has been separated from its underlying
RCW can not be used."

Which is kind of wierd because the code looks like
following

commOject = new ComObjectClass();
commObject.SomeFunc();
commObject.SomeProp = SomeValue;
CommObject.DataReady+= new dataReadyHandler(SomeHandler)

First three lines excecute just fine. And the fourth line
throws the exception.

Has anybody faced this problem? Your help / suggestions
is greatly appreciated.

Thanks.

Rahul.
 
B

bruce barker

the error means you are calling a sta com object from a different thread.
set aspcompat to true.
 
R

Rahul T.

Thanks for your response.

But the COM object I am trying to use is an apartment
threaded object. And a call on it just on the previous
line was successful.

Also I am kinda new in .net. Where do I set
the "aspcompat"

Thanks
 
S

sundar

rahul,

i'm also hitting a simiilar problem. in my case the object and client
are living in MTA. Then i found your posting. Were you able to solve
this problem or work around?

thanks,

sundar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top