By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,885 Members | 1,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,885 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.

Nov 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
the error means you are calling a sta com object from a different thread.
set aspcompat to true.
"Rahul T." <rt********@betasys.com> wrote in message
news:00****************************@phx.gbl...
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.

Nov 17 '05 #2

P: n/a
the error means you are calling a sta com object from a different thread.
set aspcompat to true.
"Rahul T." <rt********@betasys.com> wrote in message
news:00****************************@phx.gbl...
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.

Nov 17 '05 #3

P: n/a
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
-----Original Message-----
the error means you are calling a sta com object from a different thread.set aspcompat to true.
"Rahul T." <rt********@betasys.com> wrote in message
news:00****************************@phx.gbl...
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.

.

Nov 17 '05 #4

P: n/a
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
-----Original Message-----
the error means you are calling a sta com object from a different thread.set aspcompat to true.
"Rahul T." <rt********@betasys.com> wrote in message
news:00****************************@phx.gbl...
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.

.

Nov 17 '05 #5

P: n/a
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

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.