GetErrorInfo function (oleauto.h)

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


HRESULT GetErrorInfo(
  [in]  ULONG      dwReserved,
  [out] IErrorInfo **pperrinfo


[in] dwReserved

Reserved for future use. Must be zero.

[out] pperrinfo

An error object.

Return value

This function can return one of these values.

Return code Description
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.


Requirement Value
Target Platform Windows
Header oleauto.h
Library OleAut32.lib
DLL OleAut32.dll