Export (0) Print
Expand All

Controls Samples (MFC) 

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.

The following samples demonstrate ActiveX controls:

  • BUTTON   A control subclassed from a Windows button control. Demonstrates use of an in-place active menu, a stock property page, and the About box control option.

  • CIRC   A simple circle control that illustrates painting, stock properties, custom properties, mouse events, custom events, adding text and fonts, property pages, and data binding.

  • CONTAINER   A simple example of a Visual Editing container application.

  • IMAGE   A control that is capable of downloading data asynchronously.

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

  • LOCALIZE   A control with a localized user interface. Demonstrates use of separate type libraries and resource dynamic-link libraries (DLL) for localization.

  • REGSVR   This utility is used to invoke the self-registration code built into ActiveX Controls to add or remove a control's information in the registry.

  • SPINDIAL   A control with the visual appearance of a spin-dial. Demonstrates property page data validation.

  • TESTHELP   A control that has its own help file to display help for the user.

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

  • XLIST   A control, subclassed from a Windows list box, that displays text or bitmap items. Demonstrates methods, ambient properties, picture holders, and font holders.

This section includes the following container sample:

  • CONTAINER   A simple example of a Visual Editing container application.

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.

NoteTip

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

MFC Samples

Community Additions

ADD
Show:
© 2015 Microsoft