Article ID: 147740
Article Last Modified on 9/7/2005
CCirc3 m_circ;To do this in the Class View window, right-click the CWnd derived class in the Class View, point to Add, and then click Add Variable. In the Add Variable Wizard, type CCirc3 (or whatever class name was generated in step 2 by the Add ActiveX Control Wizard) as the Variable type and m_circ as the Variable name. Type a comment if you want to, and then click Finish to add the member variable to your class.
BOOL MyCWnd::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext)
{
BOOL result = CWnd::Create(lpszClassName, lpszWindowName, dwStyle,
rect, pParentWnd, nID, pContext);
if(result != 0) //Create the Circ3 ActiveX control.
result = m_circ.Create("Test", WS_VISIBLE, CRect(1,1,130, 120),
this, IDC_CIRC3CTRL1);
return result;
}
Important Parameter 5 is the ID for the control. This ID must match the ID
that is used in the ON_EVENT macro that is created in step 5. This is the ID of
the Circ3 control that is created in step 3. Keywords: kbhowto kbcontainer kbctrl kbcode KB147740