attributed ATL, forward declare interface?
-
I'm using attribute ATL, and i need to forward declare an interface but i'm not sure what the correct syntax is? this is what i currently have but i'm getting a compile error. VS2005 error MIDL2025 : syntax error : expecting a type specification near "IDLArchiveFile" [export] __interface IDLArchiveFile; [ object, uuid("3E661C7F-C4C4-4EF8-94A3-4AA9FC0F9419"), dual, helpstring("IDLArchiveDirectory Interface"), pointer_default(unique) ] __interface IDLArchiveDirectory : IDispatch { [id(6), helpstring("method GetFileAt")] HRESULT GetFileAt([in] SHORT index,[out,retval] IDLArchiveFile** pFile); }; [ object, uuid("08B48958-99C0-4AE1-91C9-1DD68B419A07"), dual, helpstring("IDLArchiveFile Interface"), pointer_default(unique) ] __interface IDLArchiveFile : IDispatch { [propget, id(3), helpstring("property Parent")] HRESULT Parent([out, retval] IDLArchiveDirectory** pVal); };
Jared Allen.
-
I'm using attribute ATL, and i need to forward declare an interface but i'm not sure what the correct syntax is? this is what i currently have but i'm getting a compile error. VS2005 error MIDL2025 : syntax error : expecting a type specification near "IDLArchiveFile" [export] __interface IDLArchiveFile; [ object, uuid("3E661C7F-C4C4-4EF8-94A3-4AA9FC0F9419"), dual, helpstring("IDLArchiveDirectory Interface"), pointer_default(unique) ] __interface IDLArchiveDirectory : IDispatch { [id(6), helpstring("method GetFileAt")] HRESULT GetFileAt([in] SHORT index,[out,retval] IDLArchiveFile** pFile); }; [ object, uuid("08B48958-99C0-4AE1-91C9-1DD68B419A07"), dual, helpstring("IDLArchiveFile Interface"), pointer_default(unique) ] __interface IDLArchiveFile : IDispatch { [propget, id(3), helpstring("property Parent")] HRESULT Parent([out, retval] IDLArchiveDirectory** pVal); };
Jared Allen.
This is going to sound snarky, but in all honesty you shouldn't use attributed ATL. It has never worked right. If at all possible, you should rewrite it in regular ATL.
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Dunder-Mifflin, this is Pam.
-
I'm using attribute ATL, and i need to forward declare an interface but i'm not sure what the correct syntax is? this is what i currently have but i'm getting a compile error. VS2005 error MIDL2025 : syntax error : expecting a type specification near "IDLArchiveFile" [export] __interface IDLArchiveFile; [ object, uuid("3E661C7F-C4C4-4EF8-94A3-4AA9FC0F9419"), dual, helpstring("IDLArchiveDirectory Interface"), pointer_default(unique) ] __interface IDLArchiveDirectory : IDispatch { [id(6), helpstring("method GetFileAt")] HRESULT GetFileAt([in] SHORT index,[out,retval] IDLArchiveFile** pFile); }; [ object, uuid("08B48958-99C0-4AE1-91C9-1DD68B419A07"), dual, helpstring("IDLArchiveFile Interface"), pointer_default(unique) ] __interface IDLArchiveFile : IDispatch { [propget, id(3), helpstring("property Parent")] HRESULT Parent([out, retval] IDLArchiveDirectory** pVal); };
Jared Allen.
I have to agree with Michael. Attributed COM/ATL is one of the most stupid idea ever conceived by the VC++ team... It's inefficient at compile time (Zzzzzz), and it causes general headaches in cases such as these. MIDL for the win!
-- Raaaaaaaaaaaaaaaaaaaaa!
-
I'm using attribute ATL, and i need to forward declare an interface but i'm not sure what the correct syntax is? this is what i currently have but i'm getting a compile error. VS2005 error MIDL2025 : syntax error : expecting a type specification near "IDLArchiveFile" [export] __interface IDLArchiveFile; [ object, uuid("3E661C7F-C4C4-4EF8-94A3-4AA9FC0F9419"), dual, helpstring("IDLArchiveDirectory Interface"), pointer_default(unique) ] __interface IDLArchiveDirectory : IDispatch { [id(6), helpstring("method GetFileAt")] HRESULT GetFileAt([in] SHORT index,[out,retval] IDLArchiveFile** pFile); }; [ object, uuid("08B48958-99C0-4AE1-91C9-1DD68B419A07"), dual, helpstring("IDLArchiveFile Interface"), pointer_default(unique) ] __interface IDLArchiveFile : IDispatch { [propget, id(3), helpstring("property Parent")] HRESULT Parent([out, retval] IDLArchiveDirectory** pVal); };
Jared Allen.
hmmm, yeah i'm not enjoying using Attributed ATL. I only used it because I started a new project in VS 2003 and it must have been the default setting back then and so i thought "It must be better and the thing todo" so it has stuck with this particular project since then... I'm not looking forward to rewriting it though, i figured that forward declaration was such a common thing that there would be a well known solution.
Jared Allen. www.chironexsoftware.com