Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Stingray Foundation Library User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

3.3 GUID Maps

Implementing QueryGuid() is a tedious and repetitive task, so using macros to write most of the code is convenient. A GUID map is a set of macros that collectively implement the QueryGuid() function. They are nearly identical to ATL's BEGIN_COM_MAP and END_COM_MAP macros, which implement QueryInterface(). Example 4 shows how you can use GUID maps to implement QueryGuid().

Example 4: Using a GUID map

The macros expand out to the same implementation of CCow::QueryGuid() shown in the previous sample.

In certain cases, a class may inherit an interface from more than one base class. That will produce an ambiguous reference in the GUID map that you must resolve with the GUID_ENTRY2 macro. Example 5 shows the GUID_ENTRY2 macro used to resolve an ambiguous reference to IQueryGuid.

Example 5: Resolving an ambiguous reference in a GUID map



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.