What Is the ATL Control-Hosting API?
ATL's control-hosting API is the set of functions that allows any window to act as an ActiveX control container. These functions can be statically or dynamically linked into your project since they are available as source code and exposed by ATL90.dll. The control-hosting functions are listed in the table below.
Function |
Description |
---|---|
Creates a host object, connects it to the supplied window, then attaches an existing control. |
|
Creates a host object, connects it to the supplied window, then loads a control. |
|
Creates a licensed ActiveX control, initializes it, and hosts it in the specified window, similar to AtlAxCreateControl. |
|
Creates a host object, connects it to the supplied window, then loads a control (also allows event sinks to be set up). |
|
Creates a licensed ActiveX control, initializes it, and hosts it in the specified window, similar to AtlAxCreateControlLic. |
|
Creates a modeless dialog box from a dialog resource and returns the window handle. |
|
Creates a modal dialog box from a dialog resource. |
|
Returns the IUnknown interface pointer of the control hosted in a window. |
|
Returns the IUnknown interface pointer of the host object connected to a window. |
|
Initializes the control-hosting code. |
|
Uninitializes the control-hosting code. |
The HWND parameters in the first three functions must be an existing window of (almost) any type. If you call any of these three functions explicitly (typically, you won't have to), do not pass a handle to a window that's already acting as a host (if you do, the existing host object won't be freed).
The first seven functions call AtlAxWinInit implicitly.
Hinweis
The control-hosting API forms the foundation of ATL's support for ActiveX control containment. However, there is usually little need to call these functions directly if you take advantage of or make full use of ATL's wrapper classes. For more information, see How Do I Create a Control Instance? and Which ATL Classes Facilitate ActiveX Control Containment?.