CAxWindow2T Class
This class provides methods for manipulating a window that hosts an ActiveX control, and also has support for hosting licensed ActiveX controls.
Important
This class and its members cannot be used in applications that execute in the Windows Runtime.
template <class TBase = CWindow>
class CAxWindow2T :
public CAxWindowT<TBase>
TBase
The class from which CAxWindowT
derives.
Name | Description |
---|---|
CAxWindow2T::CAxWindow2T | Constructs a CAxWindow2T object. |
Name | Description |
---|---|
CAxWindow2T::Create | Creates a host window. |
CAxWindow2T::CreateControlLic | Creates a licensed ActiveX control, initializes it, and hosts it in the specified window. |
CAxWindow2T::CreateControlLicEx | Creates a licensed ActiveX control, initializes it, hosts it in the specified window, and retrieves an interface pointer (or pointers) from the control. |
CAxWindow2T::GetWndClassName | Static method that retrieves the name of the window class. |
Name | Description |
---|---|
CAxWindow2T::operator = | Assigns an HWND to an existing CAxWindow2T object. |
CAxWindow2T
provides methods for manipulating a window that hosts an ActiveX control. CAxWindow2T
also has support for hosting licensed ActiveX controls. The hosting is provided by " AtlAxWinLic80", which is wrapped by CAxWindow2T
.
Class CAxWindow2
is implemented as a specialization of the CAxWindow2T
class. This specialization is declared as:
typedef CAxWindow2T <CWindow> CAxWindow2;
Note
CAxWindowT
members are documented under CAxWindow.
See Hosting ActiveX Controls Using ATL AXHost for a sample that uses the members of this class.
TBase
CAxWindowT
CAxWindow2T
Header: atlwin.h
Constructs a CAxWindow2T
object.
CAxWindow2T(HWND hWnd = NULL) : CAxWindowT<TBase>(hWnd)
hWnd
A handle of an existing window.
Creates a host window.
HWND Create(
HWND hWndParent,
_U_RECT rect = NULL,
LPCTSTR szWindowName = NULL,
DWORD dwStyle = 0,
DWORD dwExStyle = 0,
_U_MENUorID MenuOrID = 0U,
LPVOID lpCreateParam = NULL);
CAxWindow2T::Create
calls CWindow::Create with the LPCTSTR lpstrWndClass parameter set to the window class that provides control hosting (AtlAxWinLic80
).
See CWindow::Create
for a description of the parameters and return value.
Note If 0 is used as the value for the MenuOrID parameter, it must be specified as 0U (the default value) to avoid a compiler error.
See Hosting ActiveX Controls Using ATL AXHost for a sample that uses CAxWindow2T::Create
.
Creates a licensed ActiveX control, initializes it, and hosts it in the specified window.
HRESULT CreateControlLic(
DWORD dwResID,
IStream* pStream = NULL,
IUnknown** ppUnkContainer = NULL,
BSTR bstrLicKey = NULL);
HRESULT CreateControlLic(
LPCOLESTR lpszName,
IStream* pStream = NULL,
IUnknown** ppUnkContainer = NULL,
BSTR bstrLicKey = NULL);
bstrLicKey
The license key for the control; NULL if creating a nonlicensed control.
See CAxWindow::CreateControl for a description of the remaining parameters and return value.
See Hosting ActiveX Controls Using ATL AXHost for a sample that uses CAxWindow2T::CreateControlLic
.
Creates a licensed ActiveX control, initializes it, hosts it in the specified window, and retrieves an interface pointer (or pointers) from the control.
HRESULT CreateControlLicEx(
LPCOLESTR lpszName,
IStream* pStream = NULL,
IUnknown** ppUnkContainer = NULL,
IUnknown** ppUnkControl = NULL,
REFIID iidSink = IID_NULL,
IUnknown* punkSink = NULL,
BSTR bstrLicKey = NULL);
HRESULT CreateControlLicEx(
DWORD dwResID,
IStream* pStream = NULL,
IUnknown** ppUnkContainer = NULL,
IUnknown** ppUnkControl = NULL,
REFIID iidSink = IID_NULL,
IUnknown* punkSink = NULL,
BSTR bstrLickey = NULL);
bstrLicKey
The license key for the control; NULL if creating a nonlicensed control.
See CAxWindow::CreateControlEx for a description of the remaining parameters and return value.
See Hosting ActiveX Controls Using ATL AXHost for a sample that uses CAxWindow2T::CreateControlLicEx
.
Retrieves the name of the window class.
static LPCTSTR GetWndClassName();
A pointer to a string containing the name of the window class (AtlAxWinLic80
) that can host licensed and nonlicensed ActiveX controls.
Assigns an HWND to an existing CAxWindow2T
object.
CAxWindow2T<TBase>& operator= (HWND hWnd);
hWnd
A handle of an existing window.