COMPCTRL/COMPCNTR

The COMPCTRL sample demonstrates a composite control. A composite control is an ActiveX control that contain other controls. COMPCTRL contains the SMILEY and POLYGON samples. The COMPCNTR sample is a simple dialog box application that provides a container for the CCOMPCTRL control.

Before you can use the COMPCTRL sample, you need to register Compctrl.dll, Polygon.dll, and Smiley.ocx.

The CComCtrl class uses the following interfaces:

IDataObject IViewObjectEx
IDispatch IPersistStreamInit
IOleControl IPersistStorage
IOleInPlaceActiveObject IPersistStreamInit
IOleInPlaceObject IProvideClassInfo
IOleInPlaceObjectWindowless IProvideClassInfo2
IOleObject IQuickActivate
IOleWindow ISpecifyPropertyPages
IOleInPlaceObjectWindowless IViewObject
IPersist IViewObject2

When COMPCTRL is run, both the SMILEY and POLYGON controls are displayed. For more information on these controls, see SMILEY/SMILEYDG and POLYGON/POLYCNTR.

You can interact with the SMILEY sample by selecting the Smile, Sad, or Wink buttons which will case you will see a smiling, sad, or winking smiley bitmap respectively. You can also click in the box containing the face, in which case you a dialog box will appear that will indicate whether you clicked inside or outside the face.

You can add or subtract the number of sides of the polygon displayed in the POLYGON sample, by selecting the Increment or Decrement buttons respectively. You can also change a shape by clicking in the lower left/upper right half of the polygon circle.

This sample demonstrates the following keywords:

AfxEnableControlContainer CWindow::SetDlgItemText
BEGIN_MSG_MAP CWinThread::m_pMainWnd
BEGIN_SINK_MAP CWnd::CenterWindow
CComCompositeControl::CalcExtent CWnd::DoDataExchange
CComControl::m_sizeExtent CWnd::DoDataExchange
CComModule::GetClassObject CWnd::GetDesktopWindow
CComModule::GetLockCount CWnd::MessageBox
CComModule::RegisterServer CWnd::SetIcon
CComModule::UnregisterServer DECLARE_VIEW_STATUS
CComObjectRootEx::CComObjectRootEx DISPPARAMS
CComSingleThreadModel END_MSG_MAP
CDialog.DoModal END_SINK_MAP
CDialog::OnInitDialog IConnectionPointContainerImpl
COM_INTERFACE_ENTRY IDispEventImpl
COM_INTERFACE_ENTRY2 PROP_DATA_ENTRY
CStockPropImpl SINK_ENTRY
CWinApp  

You can find the COMPCTRL project files in the Wce\Samples\Atl\ COMPCTRL directory.

You can find the COMPCNTR project files in the Wce\Samples\Atl\ COMPCNTR directory.