MIDL & enum

I like to use enum in interface method. What I must do?
mizeraAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
There's nothing special about using enumerations with COM interfaces, e.g.:

typedef enum OSPXFER
{
    OSPXFER_COMPLETE = 0,
    OSPXFER_ABORT = 1,
    OSPXFER_ERROR = 2
} OSPXFER; // <-- !!!

[
        object,
        uuid(E0E270C1-C0BE-11d0-8FE4-00A0C90A6341),
        pointer_default(unique),
        local,
        version(1.4)
]
interface OLEDBSimpleProviderListener : IUnknown
{
      // As noted above; a -1 (STD_IndexAll) can be used in the row or column
      // (or both).  For example, CellChanged(STD_IndexAll, OSP_IndexAll)
      // implies that all rows and columns changed shape.

      HRESULT aboutToChangeCell([in] long iRow, [in] long iColumn);
      HRESULT cellChanged([in] long iRow, [in] long iColumn);
      HRESULT aboutToDeleteRows([in] long iRow, [in] long iColumn);
      HRESULT deletedRows([in] long iRow, [in] long cRows);
      HRESULT aboutToInsertRows([in] long iRow, [in] long cRows);
      HRESULT insertedRows([in] long iRow, [in] long cRows);
      HRESULT rowsAvailable([in] long iRow, [in] long cRows);
      HRESULT transferComplete([in] OSPXFER xfer); // <---!!!
}

(from the MSDN TDC sample)
0
All Courses

From novice to tech pro — start learning today.