Click to open or copy the CIRC project files.
This sample shows how to use ATL to make a simple ActiveX control. The CIRC sample creates a control that draws a circle and demonstrates property pages, control painting, use of color and caption properties, Click and KeyPress events, and a Color Property page.
Running the Sample
Build CIRC.DLL and make sure it is registered. Insert it in a control container and test the properties and events.
This sample uses the following keywords:
AtlCreateTargetDC; ATLTRACE; BEGIN_COM_MAP; BEGIN_CONNECTION_POINT_MAP; BEGIN_MSG_MAP; BEGIN_OBJECT_MAP; BEGIN_PROPERTY_MAP; CCircPropertyPageDlg ; CComCoClass; CComControl; CComControl::SetDirty; CComObjectRoot; CDialogImpl; CHAIN_MSG_MAP; COM_INTERFACE_ENTRY; COM_INTERFACE_ENTRY_IID; COM_INTERFACE_ENTRY_IMPL; COMMAND_ID_HANDLER; CONNECTION_POINT_ENTRY; CProxy_CircEvents; CreateEllipticRgn; CreatePen; CreateSolidBrush; CStockPropImpl; DECLARE_GET_CONTROLLING_UNKNOWN; DECLARE_REGISTRY_RESOURCEID; Ellipse; END_COM_MAP; END_CONNECTION_POINT_MAP; END_MSG_MAP; END_OBJECT_MAP; END_PROPERTY_MAP; GetClientRect; GetDialogBaseUnits; GetStockObject; GetTextMetrics; IConnectionPointContainerImpl; IConnectionPointImpl; IDataObjectImpl; IOleControlImpl; IOleInPlaceActiveObjectImpl; IOleInPlaceObjectWindowlessImpl; IOleLinkImpl; IOleObjectImpl; IOleObjectImpl::DoVerb; IPerPropertyBrowsingImpl; IPersistPropertyBagImpl; IPersistStorageImpl; IPersistStreamInitImpl; IPropertyNotifySinkCP; IPropertyPageImpl; IPropertyPageImpl::SetObjects; IProvideClassInfo2Impl; IQuickActivateImpl; IQuickActivateImpl::QuickActivate; IRunnableObjectImpl; ISpecifyPropertyPagesImpl; IViewObjectExImpl; MESSAGE_HANDLER; OBJECT_ENTRY; OleTranslateColor; PROP_ENTRY; SelectObject; SendDlgItemMessage; SetBkMode; SetTextColor; SetWindowRgn; USES_CONVERSION