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
4
votes
2 answers

How to avoid race on RCW cleanup

I have a gui application, that periodically shows the cpu load. The load is read by a StateReader class: public class StateReader { ManagementObjectSearcher searcher; public StateReader() { ManagementScope scope = new…
Boris
  • 5,094
  • 4
  • 45
  • 71
4
votes
2 answers

What is the difference between an Interop and a RCW (Runtime Callable Wrapper)?

What is the difference between an Interop and a RCW (Runtime Callable Wrapper)? Is it just terminology?
Mark Nold
  • 5,638
  • 7
  • 31
  • 33
4
votes
2 answers

How to get the System.Type of a Runtime Callable Wrapper class from its CLSID?

Note: For background information please see this related question: How to get LINQPad to Dump() System.__ComObject references? I am able to retrieve the CLSID of the RCW class corresponding to a COM object (obtained from another COM object, not…
blah238
  • 1,796
  • 2
  • 18
  • 51
3
votes
1 answer

"Option Strict On disallows implicit conversions" inconsistent enforcement

configuration 1: building ESRI add-ins for ArcMap 10.4 using Visual Studio 2015 targeting the .NET 4.5.2 framework configuration 2: building ESRI add-ins for ArcMap 10.3 using Visual Studio 2013 targeting the .NET 3.5 framework configuration 3:…
isburns
  • 41
  • 5
3
votes
1 answer

Strange COM Object Behavior in C#

I've run into an issue that I think is related to the way the CLR interops with COM objects, but I was hoping some folks here could maybe offer a little more insight. I want to apologize in advance for the vagueness of the question, unfortunately…
G K
  • 33
  • 2
2
votes
0 answers

Can we use Reflection to read COM object properties info?

Can we use Reflection to read COM object properties info? I am trying to get Property Name and Value of a COM object using the below code. But it fails. here connection is my COM object. foreach (PropertyInfo info in…
sqlnewbie
  • 857
  • 3
  • 16
  • 39
2
votes
1 answer

COM object that has been separated from its underlying RCW cannot be used, only in test debug

I am starting a WPF application from an MSTest (as a STA thread). I start the application in the assembly initialize and wait for it to complete loading. Both when I manually close the main window (which was opened from the test) and when I close it…
rainbowC
  • 21
  • 3
2
votes
1 answer

Fastest way to call a COM objects method without using a RCW

I'm trying to find the cleanest and fastest way for calling a COM objects methods. I was using a RCW for the object but every time a new version of the third party COM object comes out its GUID changes which then renders the RCW useless, so I had…
Nathan W
  • 54,475
  • 27
  • 99
  • 146
2
votes
1 answer

Has COM object been separated from its RCW?

I'm trying to fix problem with "COM object that has been separated from its underlying RCW cannot be used" error, and I think what's causing it is that COM objects are used on a thread that didn't instantiate them. I'm not allowed to do much…
Damir
  • 345
  • 4
  • 16
2
votes
1 answer

Runtime Callable Wrapper Class Not Registered

I have a dll called srxCOM.dll for titan-FTP, this dll was made for VB6. I want to use the dll in Visual Studio .NET, So I created a run-time callable wrapper using tblimp and called it srxCOMnet.dll. I've added the dll as a reference in my VS…
Ryan Dooley
  • 224
  • 1
  • 3
  • 16
2
votes
1 answer

.NET Native and RCW overhead

I'm curious about how .NET Native works. Normally when using WinRT classes in managed code, they are invoked through RCW, incurring some overhead due to the interop between managed and unmanaged code. I wonder if there is theoretically the same…
Mikhail Vasilyev
  • 503
  • 4
  • 11
2
votes
1 answer

loading C++/CLI assembly from c#

I'm writing a C++/CLI RCW around a set of proprietary COM-objects for use from a C#-application, when I deploy the RCW and the C#-application I get a FileNotFound error. After this I did the simplest thing possible: A .NET Class Library written…
BePPe
  • 29
  • 1
2
votes
0 answers

using WebBrowser Control in ASP.NET MVC application

Is it possible to create one and only WebBrowser control and keep it in Session Values and then use it when neccessary? if so, how? I create the WebBrowser object and keep it and keep it in some Session value but whenever i try to access the object,…
volkh4n
  • 402
  • 4
  • 12
2
votes
1 answer

static C# object causes: COM object that has been separated from its underlying RCW cannot be used

I have a MyObject that creates a static devDrv from an external DLL. If devDrv is created by the MyObject constructor. code works fine. If devDrv is created by one of the MyObject.Connect(see 2nd object below), the first call to MyObject.Connect()…
Kevin
  • 515
  • 4
  • 11
  • 22
1
vote
1 answer

How to manage .Net's RCW COM object creation paramets (namely requested interface)?

I'm using an external native COM component in my C# .NET application. This COM DLL doesn't have a type library, so I had to write the interop code myself, and having include/idl files I did it like TlbImp does. But the worst thing is that the object…
mistika
  • 2,363
  • 2
  • 21
  • 25