Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

ActiveX Control Containers: Connecting an ActiveX Control to a Member Variable 

The easiest way to access an ActiveX control from within its control container application is to associate the ActiveX control with a member variable of the dialog class that will contain the control.


This is not the only way to access an embedded control from within a container class, but for the purposes of this article it is sufficient.

Adding a member variable to the dialog class

  1. From Class View, right-click the main dialog class to open the shortcut menu. For example, CContainerDlg.

  2. From the shortcut menu, click Add and then Add Variable.

  3. In the Add Member Variable Wizard, click Control variable.

  4. In the Control ID list box, select the control ID of the embedded ActiveX control. For example, IDC_CIRCCTRL1.

  5. In the Variable Name box, enter a name.

    For example, m_circctl.

  6. Click Finish to accept your choices and exit the Add Member Variable Wizard.

See Also

Community Additions

© 2015 Microsoft