Article ID: 192560
Article Last Modified on 9/2/2005
// AtlAxWinInit is implemented in Atl.dll
#pragma comment(lib, "atl.lib")
#include <atldef.h>
#define _ATL_DLL_IMPL
#include <atliface.h>
Atl.dll must be shipped when you use ATL containment code, regardless
of whether you Min Size build or Min Dependency build.
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
244955 ATL projects built for MinDependency need Atl.dll if the projects use ATL control containment code in Visual C++ 6.0
//Initialize ATL control containment code.
AtlAxWinInit();
// Create the Calendar control specifying the ProgID.
// Make sure that the module handle you pass to CreateWindow is the
// same module handle where AtlAxWinInit() was called from.
HWND hWnd = ::CreateWindow("AtlAxWin", "MSCAL.Calendar",
WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL,
::GetModuleHandle(NULL), NULL);
// Same as above, except CLSID is specified instead of ProgID.
// Corresponds to ProgID "MSCAL.Calendar.7"
HWND hWnd = ::CreateWindow("AtlAxWin",
"{8E27C92B-1264-101C-8A2F-040224009C02}",
WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL,
::GetModuleHandle(NULL), NULL);
// Creates the Web Browser control and navigates to the
// specified web page.
HWND hWnd = ::CreateWindow("AtlAxWin", "http://www.microsoft.com",
WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL,
::GetModuleHandle(NULL), NULL);
// Creates an instance of an dynamic HTML document.
HWND hWnd = ::CreateWindow("AtlAxWin", "mshtml:<H1>Hello World</H1>",
WS_CHILD|WS_VISIBLE, 10, 10, 500, 300, hParent, NULL,
::GetModuleHandle(NULL), NULL);
_Module.Term()
Keywords: kbhowto kbcontainer kbatlwc kbctrl kbfaq KB192560