ID2D1RenderTarget
is an interface defined in d2d1.h
. I want to use it in my IDL interface like this:
interface IXXX : IUnknown {
HRESULT XXX([out, retval] ID2D1RenderTarget **_ppRT);
}
d2d1.idl
is not included in the SDK and I can only get d2d1.h
(no d2d1.tlb, either).
I have tried including d2d1.h
using cpp_quote:
cpp_quote("#include <d2d1.h>")
It raised:
error MIDL2025: syntax error : expecting a type specification near "ID2D1RenderTarget"
Then I added a typedef:
typedef struct ID2D1RenderTarget ID2D1RenderTarget;
The error changed to this:
error MIDL2011: unresolved type declaration : ID2D1RenderTarget [ Type 'ID2D1RenderTarget' ( Parameter '_ppRT' ) ]
I have also tried adding cpp_quote("#define D2D_USE_C_DEFINITIONS")
before the include but it made nothing.
So what should I do to use ID2D1RenderTarget
in my IDL files?