ATLCON Sample: Demonstrates Creating a Simple Container
The ATLCON sample demonstrates creating a simple container. The container implements the IOleClientSite, IOleWindow, and IOleInPlaceSite interfaces.
Container name and value columns are populated with the properties of the control which is inserted in the container.
The ATLCON attributes sample is the attributed version of this sample.
Security Note: |
---|
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended. |
To get samples and instructions for installing them:
On the Visual Studio Help menu, click Samples.
For more information, see Visual Studio Samples.
The most recent version and complete list of samples is available online from the Visual Studio 2008 Samples page.
You can also locate samples on your computer's hard disk. By default, samples and a Readme file are copied into a folder under \Program Files\Visual Studio 9.0\Samples\. For Express editions of Visual Studio, all samples are located online.
Building and Running the Sample
To build and run this sample
Open the solution file ATLCon.sln.
From the Build menu, click Build Solution.
From the Debug menu, click Start Without Debugging.
Once the sample is running, use its File menu to insert a control into the container.
Keywords
This sample uses the following keywords:
ATLASSERT; ATLTRACENOTIMPL; BEGIN_COM_MAP; BEGIN_MSG_MAP; CComCoClass; CComModule::Unlock; CComObjectRoot; CComQIPtr; CExeModule::Init; CExeModule::RegisterClassObjects; CExeModule::RegisterServer; CExeModule::RevokeClassObjects; CExeModule::Unlock; CExeModule::UnregisterServer; CExeModule::UpdateRegistryFromResource; Close; CoCreateInstance; CoInitialize; COM_INTERFACE_ENTRY; COMMAND_ID_HANDLER; CoUninitialize; CWindowImpl; DECLARE_REGISTRY_RESOURCEID; DispatchMessage; DoVerb; END_COM_MAP; END_MSG_MAP; GetClientRect; GetCommandLine; GetCurrentThreadId; GetDesktopWindow; GetMessage; GetResourceInstance; IAtlCon; IOleClientSite; IOleInPlaceSite; LoadMenu; LPOLEINPLACEFRAMEINFO; LPRECT; MESSAGE_HANDLER; MessageBox; OBJECT_ENTRY; PostQuitMessage; PostThreadMessage; SetClientSite; SetObjectRects; ShowWindow; TranslateMessage; ZeroMemory