Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Define a enum type variable on the Interface (ATL project) ? [modified]

Define a enum type variable on the Interface (ATL project) ? [modified]

Scheduled Pinned Locked Moved ATL / WTL / STL
questionc++help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    iman_kh
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • I iman_kh

      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

      J Offline
      J Offline
      Ju ncho
      wrote on last edited by
      #2

      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 :)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups