CreateErrorInfo

This function creates an instance of a generic error object.

At a Glance

Header file: Oleauto.h
Windows CE versions: 2.0 and later

Syntax

HRESULT CreateErrorInfo(ICreateErrorInfo ** pperrinfo);

Parameters

pperrinfo

Pointer to a pointer to a system-implemented generic error object.

Return Values

One of the values obtained from the returned HRESULT and described in the following table is returned.

Value Description
S_OK Success.
E_OUTOFMEMORY Could not create the error object.

Remarks

This function returns a pointer to a generic error object, which you can use with QueryInterface on ICreateErrorInfo to set its contents. You can then pass the resulting object to SetErrorInfo. The generic error object implements both ICreateErrorInfo and IErrorInfo.

Example

ICreateErrorInfo *perrinfo;
HRESULT hr;

hr = CreateErrorInfo(&pcerrinfo);

Passing into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application.