Using COM Component in .Net

As most of you know that .Net does not encourage the development of COM components and provides a different solution to making reusable components through Assemblies. But, there are a lot of COM components present which our .Net application might need to use. Fortunately, .Net provides an extremely simple approach to achieve this.

This is achieved by using ‘Wrapper Classes’ and ‘Proxy Components’. .Net wraps the COM component into .Net assembly technically called ‘Runtime Callable Wrapper’ or RCW. Then u can call and use your COM component just as a .Net (or C#, if u are using C#) Assembly.

Showing Answers 1 - 1 of 1 Answers

samiksc

  • Jan 13th, 2006
 

.Net provides facility of using COM components for backward compatibility and reusability for existing components. COM components cannot be used directly in .net since they do not follow .net structures and rules. .Net has to create a runtime callable wrapper (sort of a proxy) for using the COM components.

There are two ways in which the RCWs may be created --

  1. Through Add reference -> COM tab in a .net project. This creates a private RCW for the project.
  2. Through command line utility 'tlbimp' -- it allows creation of shared RCW for a COM component which is required for several applications. It also allows specifying RCW name and namespace.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions