{{ message }}
commap
Directory actions
More options
Directory actions
More options
commap
Folders and files
<!--TO READ THIS HELP FILE, RIGHT-CLICK ON THE FILE NAME IN THE
SOLUTION EXPLORER PANE AND SELECT "VIEW IN BROWSER"-->
<html><head><title>COMMAP Sample: Demonstrates COM Interface Map Entry Macros with Compiler COM Support</title></head><body><h1>COMMAP Sample: Demonstrates COM Interface Map Entry Macros with Compiler COM Support</h1><div id="mainSection"><div id="mainBody"><div id="allHistory" class="saveHistory" onsave="saveAll()" onload="loadAll()"></div><p /><p>This basic sample shows how different COM interface map entry macros are used. This sample uses the smart pointer mechanism (<b>_com_ptr_t</b>) of Visual C++ native compiler COM support. The <b>#import</b> mechanism is used instead of the MIDL-generated .h and .c files to provide marshaling information.</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"><div class="alert"><table width="100%" cellspacing="0" cellpadding="0"><tr><th align="left">Note </th></tr><tr><td><p>If you are running Visual C++ Express Edition, you might need to install the Platform SDK before running this sample. For information on how to do this, see <MSHelp:link keywords="971463b4-7178-42cc-87b4-566295b7ae50" tabindex="0" >How to: Use Visual C++ Express Edition with the Microsoft Platform SDK</MSHelp:link>.</p></td></tr></table></div><h4 class="subHeading">To build and run this sample</h4><div class="subSection"><ol><li><p>Open the solution commap.sln.</p></li><li><p>On the <b>Build</b> menu, click <b>Build Solution</b>.</p></li><li><p>Set ctlcomm as the startup project (right-click the project node and click <b>Set as StartUp Project</b>) and press F5. </p></li><li><p>Open Commap.htm in your Web browser. It includes comments about each type of map entry.</p></li></ol></div><p>CTLCOMM is an MFC-wrapped Visual C++ compiler COM support controller of the COMMAP ATL server. </p></div><h1 class="heading">Keywords</h1><div id="sectionSection1" class="seeAlsoNoToggleSection"><p>This sample demonstrates the following keywords: </p><p>dispinterface; #import; _com_ptr_t; _variant_t; _bstr_t; _com_error</p></div></div><div id="footer"><div class="footerLine"></div>
© Microsoft Corporation. All rights reserved. Send <a href="mailto:DevDocs@microsoft.com?subject=Documentation Feedback :COMMAP Sample: Demonstrates COM Interface Map Entry Macros with Compiler COM Support">comments</a> about this topic to Microsoft.
</div></div></body></html>
