Upgrading ActiveX Controls: Overview

HomeOverviewHow Do IFAQDetails

Beginning with Visual C++ 4.2, ActiveX controls can be optimized in several ways: optimizing persistence and initialization, providing windowless activation, turning off ActivateWhenVisible, providing mouse interaction while inactive, flicker-free activation, using an unclipped device context, and optimizing control drawing.

These enhancements minimize control size by requiring fewer interfaces and increase performance by allowing controls to share the container’s window and optimizing drawing and activation. (Typically, creating a window takes 60% of a control’s creation time.) Windowless controls also make it possible to have transparent and nonrectangular controls.

With MFC versions 4.2 and later, you can also load ActiveX control properties asynchronously. For information about adding asynchronous property support to an existing control, see How Do I Update an Existing OLE Control to Use New ActiveX Control Features?.

When you create a new control using the ActiveX ControlWizard, you can choose to include optimizations and asynchronous properties automatically in the wizard-generated code by selecting them in the Advanced Options dialog box. If your control was created with a version of Visual C++ prior to 4.2, you can update your control to take advantage of the new ActiveX control features. For a detailed discussion of how to add these features to an existing control, see ActiveX Controls: Optimization. For detailed information about the MFC member functions that implement these optimizations, see COleControl. The member functions are listed by use, such as Windowless Operations and Inactive Pointer Handling Functions.

When preparing your existing ActiveX control for use on the Internet, there are additional steps needed to make it perform well in an online environment. For details about these, including packaging your code for download, and code signing, see Upgrading an Existing ActiveX Control to be Used on the Internet.