我正在尝试从 mingw 项目访问 imapi2 com 对象。我试图遵循视觉工作室的例子。我在 Microsoft SDK 7.1 中找到了 imapi2 头文件,但它们似乎没有 uuid。我看到的示例是在创建对象时使用 __uuidof 查找 uuid。像这样:
CoCreateInstance(__uuidof(MsftDiscMaster2), NULL, CLSCTX_INPROC_SERVER, __uuidof(IDiscMaster2), (void**) &m_discMaster);
但我总是得到一个错误,因为 __uuidof 那是
对 _GUID const& __mingw_uuidof() 的未定义引用。
但 __mingw_uuidof 被定义为...
#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>(); \
} \
}
...在 _mingw.h 中,从“#define __uuidof(type) __mingw_uuidof<__typeof>()”开始几行
为什么 __mingw_uuidof 的 mingw 定义不起作用?
有没有办法在 sdk 头文件中找到像 DiscMaster 这样的 imapi 对象的 uuid?或者我需要获取其他头文件吗?
Thanks