This documentation is archived and is not being maintained.

MFC Controls Samples

The topics in this section are the abstracts for the MFC ActiveX controls samples. For a list of all MFC samples, see MFC Samples.

An ActiveX control (formerly OLE control) is an ActiveX object with an extended interface that lets it behave like a control for Microsoft Windows.

BUTTON Sample: Demonstrates a Menu and a Property Page

Demonstrates use of an in-place active menu, a stock property page, and the About box control option.

CIRC Sample: ActiveX Control

Demonstrates ActiveX control basics, including control painting, stock and custom properties, stock and custom events, use of colors and fonts, the stock Font property page, the default property page, and versioning.

CONTAINER Sample: Visual Editing Container Application

Demonstrates a Visual Editing Container Application.

IMAGE Sample: Creates an ActiveX Control That Downloads Asynchronously

Demonstrates how to use MFC to build an ActiveX control that is capable of downloading data asynchronously.

LICENSED Sample: Enforces Use of Design-Time and Run-Time Licenses

A control that enforces use of a design-time and run-time license.

LOCALIZE Sample: Control with a Localized User Interface

A control with a localized user interface that demonstrates use of separate type libraries and resource dynamic-link libraries (DLLs) for localization.

NETADDR Sample: Vista Net Address Verifier Control Sample

Demonstrates use of the Windows Vista "Net Address Verifier" control.

REGSVR Sample: Invokes Self-Registration Code

Demonstrates the invocation of Self-Registration Code.

SPINDIAL Sample: Demonstrates Property Page Validation

A control with the visual appearance of a spin-dial that demonstrates property page data validation.

TESTHELP Sample: ActiveX Control with Tooltips and Help

An ActiveX control that has its own help file and tooltips.

TIME Sample: Fires a Timer at Set Intervals

A control that is invisible at run time and fires a timer event at set intervals. Demonstrates notification functions and ambient properties.

XLIST Sample: Displays Text or Bitmaps

A control, subclassed from a Windows list box, that displays text or bitmap items.

To place ActiveX controls or objects in the Toolbox window, see Customize Toolbox Dialog Box. Once inserted, the ActiveX controls can be dragged to the dialog box that you are constructing.

TipTip:

To quickly add registered ActiveX controls to a dialog box template, see Viewing and Adding ActiveX Controls to a Dialog Box.

For the following procedure to work, the ActiveX development tools must be installed and the development environment must be open.

  1. Open the ActiveX Control Test Container. See Testing Properties and Events with Test Container for information on how to access Test Container.

  2. On the File menu, click Register Controls.

    The Register Controls dialog box appears.

  3. Click Register and browse to the directory in which the ActiveX control is installed.

  4. In the File name list, double-click the file of the control. Test Container will register the control and add it to the list under Registered Controls in the Register Controls dialog box.

  5. Click Close to close the Register Controls dialog box. You can now insert your control in Test Container or in any dialog box or form you want.

The ActiveX Control Test Container is a tool for testing and debugging ActiveX controls. You can use it to test a control's functionality by changing the control's properties, invoking its methods, and firing its events. See Testing Properties and Events with Test Container for information on using Test Container.

Other Resources

Show: