description | title | ms.date | helpviewer_keywords | ms.assetid | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Learn more about: ActiveX Control Containers: Connecting an ActiveX Control to a Member Variable |
ActiveX Control Containers: Connecting an ActiveX Control to a Member Variable |
11/04/2016 |
|
7898a336-440d-4a60-be43-cb062b807aee |
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.
Note
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.
-
From Class View, right-click the main dialog class to open the shortcut menu. For example,
CContainerDlg
. -
From the shortcut menu, click Add and then Add Variable.
-
In the Add Member Variable Wizard, click Control variable.
-
In the Control ID list box, select the control ID of the embedded ActiveX control. For example,
IDC_CIRCCTRL1
. -
In the Variable Name box, enter a name.
For example, m_circctl.
-
Click Finish to accept your choices and exit the Add Member Variable Wizard.