COMSTL has had this for several years, in the form of its IID_traits<>
class template, where it forms an integral part of the interface_cast<>
mechanisms. It also resolves to using __uuidof on compilers that support
it. See comstl_interface_cast.h, comstl_interface_traits.h &
comstl_interface_traits_std.h
The full technique's explained in detail in Chapter 19 of my book,
Imperfect C++ (http://www.awprofessional.com/titles/0321228774/).
Cheers
Matthew Wilson
Author: "Imperfect C++", Addison-Wesley, 2004
(http://www.imperfectcplusplus.com)
Contributing editor, C/C++ Users Journal
(http://www.synesis.com.au/articles.html#columns)
STLSoft moderator
(http://www.stlsoft.org)
-------------------------------------------------------------------------------
"So far, C++ is the best language I've discovered to say what I want to
say" -- Alex Stepanov
-------------------------------------------------------------------------------
<nyra sohu.com> wrote in message news:ctpu8p$2bqr$1 digitaldaemon.com...