CWnd::CreateControl

Call this member function to create an ActiveX control that will be represented in the MFC program by a CWnd object. CreateControl is a direct analog of the CWnd::Create function, but it creates an ActiveX control instead of an ordinary window.

Syntax

BOOL CreateControl(REFCLSID clsid, LPCTSTR pszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist=NULL, BOOL bStorage=FALSE, BSTR bstrLicKey=NULL);

BOOL CreateControl(LPCTSTR pszClass, LPCTSTR pszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CFile* pPersist=NULL, BOOL bStorage=FALSE, BSTR bstrLicKey=NULL);

At a Glance

Header File Afxwin.h
Platforms
Versions 2.0 and later
Complete documentation Visual C++ documentation

See Also

CWnd Overview, CWnd Member Functions, Window Class Categories, CWnd::CWnd, CWnd::CreateEx