[WEBINAR] Better to Ask Permission? Best Practices for Privacy and Security

Runtime Callable Wrapper (RCW)

Definition - What does Runtime Callable Wrapper (RCW) mean?

A runtime callable wrapper (RCW) is a wrapper object generated by common language runtime (CLR) to encapsulate a component object model (COM) object for exposing it as a .NET assembly.

A RCW acts as primary interface for a .NET client that needs to interact with a COM component by marshaling the calls between them. It forms a metadata wrapper that exposes the COM components to the CLR. It helps existing ActiveX containers to host .NET controls and helps .NET Windows Forms applications to host ActiveX containers. RCW is also useful in business systems that have been built using COM components, allowing for the integration of their old legacy code with newly developed .NET components without impacting productivity.

Techopedia explains Runtime Callable Wrapper (RCW)

A COM component is a binary reusable object that provides its services by publishing the interfaces through which communication with its clients occurs. The definition of the interfaces or binary contracts of the COM component is specified in the interfaces' type library. Unlike COM, communication between .NET objects is object-based rather than interface-based. RCW acts as a bridge between COM components and .NET objects to route the operations and mediate between the two by marshaling.

A RCW manages the lifetime of its encapsulated COM object. While passing the reference between two application domains or apartments, proxy of the object will be used. Creation of RCW is based on the metadata derived from the type library. Its destruction occurs during garbage collection. Marshaling by RCW includes the conversion of method arguments and return values such that they are represented in a manner that can be read by both the client and server. An example for marshaling may be the conversion that takes place for a string argument that needs to be passed as BSTR type for a COM component, while it has to be string type in a .NET client.

RCW can be created using Visual Studio, which uses an automatic code generation facility, making the process simple and transparent for the user. Alternatively, RCW assembly contains metadata for types defined in the type library of a component can be created use the tlbimp.exe tool from the command line.

This definition was written in the context of .NET
Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.