Forward declaration of interfaces
-
I have 2 interfaces that reference each other (A & B) and the MIDL compiler is not happy... :-( in A's header file...
__interface IA : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); };
in B's header file...__interface IB : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); };
if i don't forward declare the interfaces I get a C++ syntax error if i forward declare the interfaces with the__interface
keyword, I get: error MIDL2025 : syntax error : expecting a type specification near "IImageHSV" if i forward declare the interfaces with theinterface
keyword, I get: error MIDL2003 : redefinition : IImageHSV Any suggestions much appreciated -
I have 2 interfaces that reference each other (A & B) and the MIDL compiler is not happy... :-( in A's header file...
__interface IA : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); };
in B's header file...__interface IB : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); };
if i don't forward declare the interfaces I get a C++ syntax error if i forward declare the interfaces with the__interface
keyword, I get: error MIDL2025 : syntax error : expecting a type specification near "IImageHSV" if i forward declare the interfaces with theinterface
keyword, I get: error MIDL2003 : redefinition : IImageHSV Any suggestions much appreciated -
You mean a different GUID? Can a forward declaration have a GUID? Don't think so... Why isn't everyone having this problem :-D ?
-
I have 2 interfaces that reference each other (A & B) and the MIDL compiler is not happy... :-( in A's header file...
__interface IA : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); };
in B's header file...__interface IB : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); };
if i don't forward declare the interfaces I get a C++ syntax error if i forward declare the interfaces with the__interface
keyword, I get: error MIDL2025 : syntax error : expecting a type specification near "IImageHSV" if i forward declare the interfaces with theinterface
keyword, I get: error MIDL2003 : redefinition : IImageHSV Any suggestions much appreciatedI do that all the time [uuid(... ] library MyCoolLib { interface IB; [ object, uuid(...),dual...] interface IA : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); }; [ object, uuid(...),dual...] interface IB : IDispatch { [id(1), helpstring("")] HRESULT func([in] IA* pB); };
-
I do that all the time [uuid(... ] library MyCoolLib { interface IB; [ object, uuid(...),dual...] interface IA : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); }; [ object, uuid(...),dual...] interface IB : IDispatch { [id(1), helpstring("")] HRESULT func([in] IA* pB); };
I'm using the ATL Wizard in VS.NET which puts the IDL and C++ in the same file, so I have to use the __interface keyword, which I think is the problem because the MIDL compiler doesn't recognize the forward declaration using __interface. Maybe. Arrghh. :)
-
I have 2 interfaces that reference each other (A & B) and the MIDL compiler is not happy... :-( in A's header file...
__interface IA : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); };
in B's header file...__interface IB : IDispatch { [id(1), helpstring("")] HRESULT func([in] IB* pB); };
if i don't forward declare the interfaces I get a C++ syntax error if i forward declare the interfaces with the__interface
keyword, I get: error MIDL2025 : syntax error : expecting a type specification near "IImageHSV" if i forward declare the interfaces with theinterface
keyword, I get: error MIDL2003 : redefinition : IImageHSV Any suggestions much appreciatedI am facing the same problem and have not able to find out any solution yet. I tried inserting interface declaration statements in IDL file using "cpp_quote" attribute also but that does not work even (it inserts the line including "cpp_quote" :() Rowan, have you been able to find out any solution yet. If you had already, do post it... it would be a great help ! Thanx & Regards, Arun.
-
I am facing the same problem and have not able to find out any solution yet. I tried inserting interface declaration statements in IDL file using "cpp_quote" attribute also but that does not work even (it inserts the line including "cpp_quote" :() Rowan, have you been able to find out any solution yet. If you had already, do post it... it would be a great help ! Thanx & Regards, Arun.
Alas I've given up trying - but I'll remember to put it here if I ever fix it