Skip to content

Latest commit

 

History

History
 
 

Polygon

<!--TO READ THIS HELP FILE, RIGHT-CLICK ON THE FILE NAME IN THE
    SOLUTION EXPLORER PANE AND SELECT "VIEW IN BROWSER"-->

<html><head><title>POLYGON Attributes Sample: Demonstrates Custom Properties, Events, a Property Page, and Object Safety</title></head><body><h1>POLYGON Attributes Sample: Demonstrates Custom Properties, Events, a Property Page, and Object Safety</h1><div id="mainSection"><div id="mainBody"><div id="allHistory" class="saveHistory" onsave="saveAll()" onload="loadAll()"></div><p /><p>The POLYGON attributes sample shows how to implement custom properties, events, a property page, and object safety for an ATL control. The POLYGON sample is the nonattributed version of this sample and is used as the basis of the <MSHelp:link keywords="F921A121-09C8-4812-9317-E15B2F1471FA" tabindex="0" >ATL Tutorial</MSHelp:link>.</p><div class="alert"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left">Security Note </th></tr><tr><td><p>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.</p></td></tr></table></div><h1 class="heading">Building and Running the Sample</h1><div id="sectionSection0" class="seeAlsoNoToggleSection"><h4 class="subHeading">To build and run this sample</h4><div class="subSection"><ol><li><p>Open the solution file Polygon.sln.</p></li><li><p>From the <b>Build</b> menu, click <b>Build</b>.</p></li><li><p>After the sample builds, open PolyCtl.htm in your Web browser and try out the Polygon control. If you click inside the polygon, the number of sides increases. If you click outside the polygon, the number of sides decreases.</p></li></ol></div><p>You can test the Polygon control in the ActiveX Control Test Container. For details on accessing Test Container and using it to test a control, see <MSHelp:link keywords="626867CF-FE53-4C30-8973-55BB93EF3917" tabindex="0" >Testing Properties and Events with Test Container</MSHelp:link>.</p></div><h1 class="heading">Attributes</h1><div id="sectionSection1" class="seeAlsoNoToggleSection"><p>This sample uses the following attributes:</p><p>coclass, default, dispinterface, dual, event_source, helpstring, id, implements_category, in, module, object, out, pointer_default, progid, propget, propput, registration_script, retval, support_error_info, threading, uuid, version, vi_progid</p></div><h1 class="heading">Keywords</h1><div id="sectionSection2" class="seeAlsoNoToggleSection"><p>This sample uses the following keywords:</p><p>ATLASSERT; ATLTRACE; auxWireSphere; BEGIN_COM_MAP; BEGIN_CONNECTION_POINT_MAP; BEGIN_MSG_MAP; BEGIN_OBJECT_MAP; BEGIN_PROPERTY_MAP; CComCoClass; CComControl; CComModule::GetClassObject; CComModule::GetLockCount; CComModule::Init; CComModule::RegisterServer; CComModule::Term; CComModule::UnregisterServer; CComObjectRoot; ChoosePixelFormat; CoTaskMemAlloc; CreateContext; CreateRGBPalette; DECLARE_GET_CONTROLLING_UNKNOWN; DECLARE_REGISTRY_RESOURCEID; DeleteObject; DescribePixelFormat; DisableThreadLibraryCalls; DrawText; END_CONNECTION_POINT_MAP; END_OBJECT_MAP; FireViewChange; GetClientRect; GetPixelFormat; glBegin; glClear; glClearColor; glClearDepth; glColor3f; glEnable; glEnd; glFinish; glLoadIdentity; glMatrixMode; glPopMatrix; glPushMatrix; glRotatef; glTranslatef; gluPerspective; glVertex3f; IDispatchImpl; IObjectSafetyImpl; IOleControlImpl; IOleInPlaceActiveObjectImpl; IOleInPlaceObjectWindowlessImpl ; IOleObjectImpl; IPersistStorageImpl; IPersistStreamInitImpl; IViewObjectExImpl; joyReleaseCapture; joySetThreshold; memcpy; OBJECT_ENTRY; PIXELFORMATDESCRIPTOR; RealizePalette; ReleaseCapture; SelectPalette; SetBkMode; SetCapture; SetTextColor; SwapBuffers; USES_CONVERSION; wglCreateContext; wglDeleteContext; wglGetCurrentDC; wglMakeCurrent</p><div class="alert"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left">Note </th></tr><tr><td><p>Some of the samples, such as this one, have not been modified to reflect the changes in the Visual C++ wizards, libraries, and compiler, but still demonstrate how to complete your desired task. </p></td></tr></table></div></div></div><div id="footer"><div class="footerLine"></div>
          © Microsoft Corporation. All rights reserved.  Send <a href="mailto:DevDocs@microsoft.com?subject=Documentation Feedback :POLYGON Attributes Sample: Demonstrates Custom Properties, Events, a Property Page, and Object Safety">comments</a> about this topic to Microsoft.
      </div></div></body></html>