Sequence of Operations for Creating ActiveX Controls

OverviewHow Do ITutorial

The following table shows your role and the framework's role in creating ActiveX controls (formerly known as OLE controls).

Creating ActiveX Controls

Task You do The framework does
Create an ActiveX control framework. Run a custom AppWizard, called ActiveX ControlWizard, to create your control. Specify the options you want in the options pages. Options include number of controls in the project, licensing, subclassing, and an About Box method. AppWizard creates the files for an ActiveX control with basic functionality, including source files for your application, control, and property page(s); a resource file; a project file; and others — all tailored to your specifications.
See what the control and ActiveX ControlWizard offer without adding a line of your own code. Build the ActiveX control and test it with Test Container. The running control has the ability to be resized and moved. It also has an About Box method (if chosen) that can be invoked.
Implement the control's methods and properties. Implement your control-specific methods and properties by adding member functions to provide an exposed interface to the control's data. Add member variables to hold data structures and use event handlers to fire events when you determine. The framework has already defined a map to support the control's events, properties, and methods, leaving you to focus on how the properties and methods are implemented. The default property page is viewable and a default About Box method is supplied.
Construct the control's property page(s). Use the Visual C++ resource editors to visually edit the control's property page interface:
  • Create additional property pages.

  • Create and edit bitmaps, icons, and cursors.

You can also test the property page(s) in the dialog editor.

The default resource file created by AppWizard supplies many of the resources you need. Visual C++ lets you edit existing resources and add new resources easily and visually.
Test the control's events, methods, and properties. Rebuild the control and use Test Container to test that your handlers work correctly. You can invoke the control's methods and manipulate its properties through the property page interface or through Test Container. In addition, use Test Container to track events fired from the control and notifications received by the control's container.

What do you want to know more about?