13.9. Use an ActiveX Control in a .NET Client

Problem

You need to place an ActiveX control on a form or a user control in a .NET Framework application.

Solution

Use an RCW exactly as you would with an ordinary COM component (see recipe 13-6). To work with the ActiveX control at design time, add it to the Visual Studio 2008 Toolbox.

How It Works

As with COM components, the .NET Framework fully supports the use of ActiveX controls. When working with COM (detailed in recipe 13-6), an RCW is required to allow communication between your code and the COM object. An ActiveX control differs in that it requires two RCWs. The first RCW provides communication between the COM object and the second RCW. The second RCW is required to communicate between the ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach 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.