.NET components call COM components.

 .NET Components can call COM components

The proxy used in calling unmanaged code from managed code is known as a Runtime-Callable Wrapper, or RCW.

Ways to create RCW are listed below :

1. Converting Metadata with TLBIMP

 tlbimp (type library importer) is tool which reads the metadata from a COM type library and creates a matching CLR assembly for calling the COM component.

tlbimp COMsupport.dll /out:NETsupport.dll

2. Using COM Components Directly

1.     Click Project, and then click Add Reference.
2.     In the Add Reference dialog box, click the COM tab.
3.     Select the type library you wish to use from the list and click Select, or use the Browse button to locate a component that’s not listed. The selected components will be added to the lower listview in the dialog box.
4.     Click OK to create RCWs for the selected type libraries in your Visual Basic .NET or C# project.

 

Leave a Reply