SCODE

SCODE is a data type that is a 32-bit status value. MAPI functions and methods return values of the SCODE type.

typedef ULONG     SCODE;

 

Remarks

All MAPI functions and methods return SCODE values; some MAPI functions also return warnings, which are nonzero HRESULT values.

To obtain an SCODE value from an HRESULT value, the client application can use the OLE function GetScode as follows:

SCODE scode;

HRESULT hresult;

 

hresult = arbitrary function call;

 

if (hresult)

     scode = GetScode(hresult);

/* Display error based on scode */ 

}

 

When a MAPI function returns an HRESULT value as a warning, an SCODE return value can be identified as a type of success. For example:

hresult = SomeCall(..)

if (hresult !=0)

     SCODE scode = GetScode(hresult);

     if (FAILED(scode))

          goto error;

     /*Handle the warning here */

     if (scode == MAPI_W_warning)

    

     }

}

See Also

HRESULT