Using .NET Components in COM Applications

As you saw, using COM components in a .NET application was an easy task. Now, it's time to look at the reverse situation, in which you will call a .NET component from a COM application. This situation is not quite as clean as using COM components in .NET because you have to perform some tricks to get it to work.

Preparing the .NET Component for COM Clients

The first thing you want to do to have a .NET component that can be called by a COM client is to create your .NET component as you normally do. Start a new Class Library named NetInterop. Inside Class1.vb, you'll change the class name to EmpNet and enter the code that gives you the same functionality as the COM component from earlier. Your final code ...

Get A Programmer's Introduction to Visual Basic® .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.