ATL7 probs with enum in interface
-
In ATL6 (VS6) creating an interface like this
interface ICtrl1 : IDispatch { typedef enum {Diedel, Doedel, Doing} DUMMY; [id(1), helpstring("method Foo")] HRESULT Foo([in]DUMMY Dummy); };
in Foo.idl the file was properly compiled by MIDL. However doing the same in ATL7 in the controls headerfile__interface ICtrl1 : public IDispatch { typedef enum {Diedel, Doedel, Doing} DUMMY; [id(1), helpstring("method Foo")] HRESULT Foo([in] DUMMY Dummy); };
results in an error MIDL2025 : syntax error : expecting a type specification near "DUMMY". I have no idea what I am doing wrong here :confused::confused::confused: Rainer -
In ATL6 (VS6) creating an interface like this
interface ICtrl1 : IDispatch { typedef enum {Diedel, Doedel, Doing} DUMMY; [id(1), helpstring("method Foo")] HRESULT Foo([in]DUMMY Dummy); };
in Foo.idl the file was properly compiled by MIDL. However doing the same in ATL7 in the controls headerfile__interface ICtrl1 : public IDispatch { typedef enum {Diedel, Doedel, Doing} DUMMY; [id(1), helpstring("method Foo")] HRESULT Foo([in] DUMMY Dummy); };
results in an error MIDL2025 : syntax error : expecting a type specification near "DUMMY". I have no idea what I am doing wrong here :confused::confused::confused: RainerI am little bit rusty in IDL, but I do not think enum inside of interface is valid syntax (granted that VC6 compiled that). Compile in VC6, use OleView on the resulting tlb, my guess is that older MIDL just silently moved that typedef out of interface definition during compilation.