I am trying to access imapi2 com objects from a mingw project. I was trying to follow a visual studio example. I found the imapi2 header files in Microsoft SDK 7.1, but they do not seem to have the uuid's. The example I saw was using __uuidof for finding the uuid when creating an object. Like this:
CoCreateInstance(__uuidof(MsftDiscMaster2), NULL, CLSCTX_INPROC_SERVER, __uuidof(IDiscMaster2), (void**) &m_discMaster);
But I always get an error because of __uuidof that is
undefined reference to _GUID const& __mingw_uuidof().
But __mingw_uuidof is defined as ...
#define __CRT_UUID_DECL(type,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
extern "C++" { \
template<> inline const GUID &__mingw_uuidof<type>() { \
static const IID __uuid_inst = {l,w1,w2, {b1,b2,b3,b4,b5,b6,b7,b8}}; \
return __uuid_inst; \
} \
template<> inline const GUID &__mingw_uuidof<type*>() { \
return __mingw_uuidof<type>(); \
} \
}
... in _mingw.h a few lines up from "#define __uuidof(type) __mingw_uuidof<__typeof(type)>()"
Why does the mingw definition for __mingw_uuidof not work?
Is there some way to find the uuid for imapi objects like DiscMaster in the sdk header files? Or do I need to get someother header file.
Thanks