#include <comstl/util/interface_traits.hpp>
This traits class takes an interface type and provides a specialisation that has a statid iid() method which returns the interface identifier (IID) for that type.
To use, simply have the expression IID_traits<I>::iid() where I is your interface type.
On compilers that support the __uuidof pseudo-operator this is used, otherwise you must specify specialisations - using the COMSTL_IID_TRAITS_DEFINE macro - for your interfaces, as in
COMSTL_IID_TRAITS_DEFINE(IMyInterface)
All the interfaces currently defined in unknown.idl and objidl.idl are so defined in the file comstl_interface_traits_std.h, which is included in for non-__uuidof compilations.
I | The interface |
Static Public Member Functions | |
static REFIID | iid () |
Returns a reference to the IID for the parameterising interface. |
static REFIID iid | ( | ) | [static] |
Returns a reference to the IID for the parameterising interface.