473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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

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
5 11662
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rahul T. | last post by:
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...
1
by: Marco Castro | last post by:
I'm getting the error "COM object that has been separated from its underlying RCW can not be used." whenever I run one of my functions too much. It didn't use to this until I moved part of it into...
3
by: Neal Miller | last post by:
Hi all I've gotten this error: Err# 5 COM object that has been separated from its underlying RCW can not be used I have researched this some, and have discovered that it has something...
2
by: Steve | last post by:
(I posted this in the ADO.NET NG, but didn't get any responses) I've started getting this exception since installing vs2005 "COM object that has been separated from its underlying RCW cannot be...
12
by: Joe | last post by:
I might be overworked so please excuse this stupid question... Say I do the following: DataTable table = new DataTable(); myDataAdaptor.Fill(table); dataGrid1.DataSource = table;
4
by: Michael Maes | last post by:
Hi, On closing our App, we get following 'InvalidComObjectException': "COM object that has been separated from its underlying RCW cannot be used" The App has been upgraded from .Net1.1 to...
0
by: Peter | last post by:
Hi, everybody, Error message is "COM object that has been separated from its underlying RCW can not be used." When I called the codes below. So I traced the error and found it is caused by...
3
by: Eric Mahurin | last post by:
Is there a standard way to get a descriptor object for an arbitrary object attribute - independent of whether it uses the descriptor/ property protocol or not. I want some kind of...
4
by: johnxhc | last post by:
We have a project in .NET 1.1 , some of the .NET methods take COM interface reference pointer as a parameter, somehow we have to call Marshal.ReleaseComObject to release the COM Object, otherwise...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.