Questions tagged [rcw]

The common language runtime exposes COM objects through a proxy called the runtime callable wrapper (RCW). Although the RCW appears to be an ordinary object to .NET clients, its primary function is to marshal calls between a .NET client and a COM object.

Runtime Callable Wrapper

The runtime creates exactly one RCW for each COM object, regardless of the number of references that exist on that object. The runtime maintains a single RCW per process for each object. If you create an RCW in one application domain or apartment, and then pass a reference to another application domain or apartment, a proxy to the first object will be used. As the following illustration shows, any number of managed clients can hold a reference to the COM objects that expose INew and INewer interfaces.

http://msdn.microsoft.com/en-us/library/8bwh56xe(v=vs.110).aspx

63 questions
0
votes
1 answer

How can I "replace" the interface for an object returned from COM to managed code?

I face some weird performance issues and I suspect that they may arise from having a dynamic specified as return type of a COM interface method. Specifically this is how IHTMLDOMChildrenCollection interface ends up in the…
sharptooth
  • 167,383
  • 100
  • 513
  • 979
0
votes
1 answer

Removing CompilerOptions directive for an interop

I've created an interop for a COM dll via tlbimp and added it to the assembly cache. To use this in an ASP.net page i need to include the following <%@ Page Language="VB" Debug="true" CompilerOptions='/R:"C:\Program…
Mark Nold
  • 5,638
  • 7
  • 31
  • 33
0
votes
0 answers

Find office COM object and release it properly

I am using an Application which do word and excel automation but does not release the COM objects properly. I have no access to the source code, so I would like to release the COM objects myself in a Windows Service. Can I identify if an excel or…
BR75
  • 633
  • 7
  • 25
0
votes
2 answers

"COM object that has been separated from its underlying RCW cannot be used" error related to vb.net form event

I'm hooking an arcobjects map event to a vb.net form to listen for map selection changes. This all works fine but users are reporting this error occassionally when opening the form. I can't see any pattern to reproduce the error and it seems to be…
Courlu
  • 106
  • 2
  • 8
0
votes
0 answers

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

I have a little function in my asp / C# site which exports some data through excel using PIA. After some research along days about how to use properly all of this, sometimes I'm getting this error: COM object that has been separated from its…
Mortuk
  • 3
  • 3
0
votes
0 answers

Why does an RCW handle WM_PAINT when calling it from its own apartment

My application is native windows application (MFC/Win32) which loads .NET plugins via COM. The application exposes its document model via COM (implemented in ATL). I have a line of code which looks like this on the .NET side: var settings =…
Yngve Hammersland
  • 1,634
  • 2
  • 14
  • 28
0
votes
1 answer

Why would this raise an InvalidClassCast exception?

For certain reasons, I must provide manually written runtime callable wrappers for a number of COM components offered by my shop. This is the interface definition for component A: [ComImport, Guid("02922621-2EAE-4442-8A0A-C1C3CD886027")] public…
Pedro Lamarão
  • 531
  • 5
  • 22
0
votes
1 answer

How do i transfer this unmanaged code from asp to asp.net 2/mvc?

i'm a newbie to ASP.net interop features, so what i have right here is some unmanaged dll that i need to call from my asp.net mvc app. the dll name is CTSerialNumChecksum.dll. i can easily call the dll from asp using just those two lines below and…
melaos
  • 8,386
  • 4
  • 56
  • 93
0
votes
0 answers

Can an IActivationFactory return the same instance multiple times?

While exploring WinRT, I made an experiment with singletons: by implementing the IActivationFactory myself, I can make a singleton "at the ABI level". The factory just returns the same instance every time. By extension, any call to…
CÅdahl
  • 442
  • 3
  • 13
0
votes
0 answers

Is it necessary to explicitly Invoke calls to COM object's thread?

I am using a 3rd party Activex control from .NET. I have successfully created the RCWs (AxInterop.ACMELib.dll and Interop.ACMELib.dll) by adding a reference to the ActiveX ocx and dragging a control onto my form. At this point, the interface that…
djv
  • 15,168
  • 7
  • 48
  • 72
0
votes
2 answers

Does COM's put_XXX methods change to set_XXX in a .NET RCW

I have a COM component that has get_XXX and put_XXX methods inside it. I used it in a .NET project and a RCW was generated for it. I now see get_XXX and set_XXX methods and NOT the put_XXX one? Is that automatic or defined somewhere in IDL?
A9S6
  • 6,575
  • 10
  • 50
  • 82
0
votes
1 answer

The type 'COMSVCSLib.ObjectControl' is defined in an assembly that is not referenced

I have two VB 6 assemblies (DLLs). ProgramA.dll, and ProgramB.dll, which I need to add as reference in my .NET Web Service (version 2.0). I was handed over these two DLLs by different developers. One developer gave me simply ProgramA.dll The other…
Nirman
  • 6,715
  • 19
  • 72
  • 139
0
votes
1 answer

c++ - COM object that has been separated from its underlying RCW cannot be used

My problem is the error message in the title: COM object that has been separated from its underlying RCW cannot be used. I have tried to google it, but i could find only solutions related to destructors/releasing objects. It is not something i want…
skandigraun
  • 741
  • 8
  • 21
0
votes
1 answer

Code Coverage in VS2008 on .net runtime callable wrappers

I have a .DLL which contains .NET Runtime callable wrappers for COM/DCOM objects. I have written a testing suite in C# in VS 2008 which calls our server functions which are in the abovementioned .DLL. When code coverage was turned on and testing…
Boris Kleynbok
  • 317
  • 2
  • 5
  • 15
0
votes
1 answer

C# 2005 COM and .NET Access Denied 0x80070005 E_ACCESSDENIED

I am rewriting a C++ app in C# 2005. The App has 2 components: one out-of-process COM server which can be started by a C++ service. The COM server uses outgoing interface, meaning it invokes event handler method from the C++ service module upon…
Kam P