【发布时间】:2015-02-13 07:20:41
【问题描述】:
ID2D1RenderTarget 是d2d1.h 中定义的接口。我想像这样在我的 IDL 界面中使用它:
interface IXXX : IUnknown {
HRESULT XXX([out, retval] ID2D1RenderTarget **_ppRT);
}
d2d1.idl 不包含在 SDK 中,我只能得到 d2d1.h(也没有 d2d1.tlb)。
我尝试使用 cpp_quote 包含 d2d1.h:
cpp_quote("#include <d2d1.h>")
它提出了:
error MIDL2025: syntax error : expecting a type specification near "ID2D1RenderTarget"
然后我添加了一个typedef:
typedef struct ID2D1RenderTarget ID2D1RenderTarget;
错误改成这样:
error MIDL2011: unresolved type declaration : ID2D1RenderTarget [ Type 'ID2D1RenderTarget' ( Parameter '_ppRT' ) ]
我也尝试在包含之前添加cpp_quote("#define D2D_USE_C_DEFINITIONS"),但没有任何效果。
那么我应该怎么做才能在我的 IDL 文件中使用 ID2D1RenderTarget?
【问题讨论】:
标签: c++ visual-c++ com idl midl