GetErrorInfo Function

Obtains the error information pointer set by the previous call to SetErrorInfo in the current logical thread.

HRESULT GetErrorInfo( 
  DWORD  dwReserved,
  IErrorInfo  **pperrinfo
);

dwReserved

Reserved for future use. Must be zero.

pperrinfo

Pointer to a pointer to an error object.

The return value obtained from the returned HRESULT is one of the following:

Return value

Meaning

S_OK

Success.

S_FALSE

There was no error object to return.

This function returns a pointer to the most recently set IErrorInfo pointer in the current logical thread. It transfers ownership of the error object to the caller, and clears the error state for the thread.

Making a COM call that goes through a proxy-stub will clear any existing error object for the calling thread. A called object should not make any such calls after calling SetErrorInfo and before returning. The caller should not make any such calls after the call returns and before calling GetErrorInfo. As a rule of thumb, an interface method should return as soon as possible after calling SetErrorInfo, and the caller should call GetErrorInfo as soon as possible after the call returns.

Show:
© 2014 Microsoft