Description.

COM object are a fast and simple way to add power to a web page or application.
It allows functionality you to leverage your skills in another language from C#. I have
also found that if I don't have time to work out how to do it in C# then I write it
in C++ as a COM object and call the COM from C#. This simple code sample shows how
to do this with a simple COM object.

Here is a sample.

In this sample I will call an Object called Search in a DLL
called McTainshCom.dll. I will access a property called
BuildNo.

First Open the "Solution Explorer" for the project you want to the COM object from.

Expand the "Application" branch.

Right click on the "References" branch and select "Add Reference".

Select the "COM" Tab. (Wait a we while!)

All registered COM objects should appear in the list. If the COM you want is not in the list, check it is registered.

How to unload the COM object if using WebForms/ASPX.

Once the COM object has been loaded it will be kept in memory and can not be
replaced until IIS has been stopped. To do this either restart the computer
(quite serious) or stop the World Wide Web service. There is also a button on
the Internet Services Manager. Select the web site manager properties and open the
Home Directory tab. Here there is an Unload button. I have never had any
success with this button but it is worth a try.