About Using ActiveX Controls in IDL

If you want to incorporate a COM object that presents a user interface (that is, an ActiveX control) into your IDL application, use IDL's WIDGET_ACTIVEX routine to place the control in an IDL widget hierarchy. IDL provides the same object method and property manipulation facilities for ActiveX controls as it does for COM objects incorporated using the IDLcomIDispatch object interface, but adds the ability to process events generated by the ActiveX control using IDL's widget event handling mechanisms.

Note
IDL can only incorporate ActiveX controls on Windows platforms. See "Feature Support by Operating System" (What's New in IDL 7.1) for details.

When you use the WIDGET_ACTIVEX routine, IDL automatically creates an IDLcomActiveX object that encapsulates the ActiveX control. IDLcomActiveX objects are a subclass of the IDLcomIDispatch object class, and share all of the IDLcomIDispatch methods and mechanisms discussed in Using COM Objects in IDL. You should be familiar with the material in that chapter before attempting to incorporate ActiveX controls in your IDL programs.

Note
If the COM object you want to use in your IDL application is not an ActiveX control, use the IDLcomIDispatch object class.

Warning: Modeless Dialogs

When displaying an ActiveX form or dialog box, it is the responsibility of the COM object to pump messages. Modal dialogs pump messages themselves, but modeless dialogs do not. IDL's COM subsystem does not provide the ability to pump messages explicitly, giving IDL no way to pump messages while a modeless dialog is displayed. As a result, calling a modeless dialog from IDL will result in an error.

Registering COM Components on a Windows Machine

Before a COM object or ActiveX control can be used by a client program, it must be registered on the Windows machine. In most cases, components are registered by the program that installs them on the machine. If you are using a component that is not installed by an installation program that handles the registration, you can register the component manually. For a description of the registration process, see Registering COM Components on a Windows Machine.