Interop with ActiveX Controls

An ActiveX control relies on COM to be activated, modified, have its properties invoked, and so on. Using tlbimp on an ActiveX control doesn't work well. The aximp utility calls tlbimp and creates an appropriate interop assembly; in addition, it creates a second interop assembly that specifically deals with the properties of the ActiveX component.

After you have the interop assemblies, you can reference them in the build and create classes that implement the desired interfaces. For an ActiveX component, you can set the properties and add them to the controls for the form. You can do all of this by hand, but it's not necessary.

This sample used an ActiveX control that was developed by Brent Rector as part of the book ...

Get .NET Common Language Runtime Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.