Define a enum type variable on the Interface (ATL project) ? [modified]
-
hi, i want to define an enum type variable on the Interface , so i have defined an enum within interface and then take a property from this enum, but have encountered with a compile time error !? what is my mistake and what is its solution? interface IXFSReceipt : IDispatch { enum RPtrResolution { RPTR_RESOLUTION_LOW, RPTR_RESOLUTION_MEDIUM, RPTR_RESOLUTION_HIGH, RPTR_RESOLUTION_VERYHIGH }; HRESULT Resolution([out, retval] RPtrResolution* pVal);<<<<<<<< ERROR1 HRESULT Resolution([in] RPtrResolution newVal); }; ERROR1 : error MIDL2025 : syntax error : expecting a type specification
modified on Friday, June 27, 2008 4:44 PM
-
hi, i want to define an enum type variable on the Interface , so i have defined an enum within interface and then take a property from this enum, but have encountered with a compile time error !? what is my mistake and what is its solution? interface IXFSReceipt : IDispatch { enum RPtrResolution { RPTR_RESOLUTION_LOW, RPTR_RESOLUTION_MEDIUM, RPTR_RESOLUTION_HIGH, RPTR_RESOLUTION_VERYHIGH }; HRESULT Resolution([out, retval] RPtrResolution* pVal);<<<<<<<< ERROR1 HRESULT Resolution([in] RPtrResolution newVal); }; ERROR1 : error MIDL2025 : syntax error : expecting a type specification
modified on Friday, June 27, 2008 4:44 PM
You have to define a typedef for the enum. This should do the trick: typedef enum RPtrResolution{ RPTR_RESOLUTION_LOW, RPTR_RESOLUTION_MEDIUM, RPTR_RESOLUTION_HIGH, RPTR_RESOLUTION_VERYHIGH }RPtrResolution; [ Your Interface UID and etc... ] interface IXFSReceipt : IDispatch { HRESULT Resolution([out, retval] RPtrResolution* pVal); HRESULT Resolution([in] RPtrResolution newVal); }; Please tell me how it worked :)
JO :)