WsGetErrorString function (webservices.h)

Retrieves an error string from an error object.

Syntax

HRESULT WsGetErrorString(
  [in]  WS_ERROR  *error,
  [in]  ULONG     index,
  [out] WS_STRING *string
);

Parameters

[in] error

The error object containing the string.

[in] index

The zero-based index identifying the string to retrieve. The first error string (index 0) will be the string most recently added to the error object (using WsAddErrorString). When WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE is presented in the error object, the corresponding error text will be available in the last index.

The number of errors can be retrieved using WS_ERROR_PROPERTY_STRING_COUNT.

[out] string

The returned string. The string is valid until WsResetError or WsFreeError is called.

The string is not zero terminated.

Return value

This function can return one of these values.

Return code Description
E_INVALIDARG
One or more arguments are invalid.
Other Errors
This function may return other errors not listed above.

Remarks

The string is in the language specified by the LANGID property of the error object. This can be retrieved using WsGetErrorProperty with WS_ERROR_PROPERTY_LANGID.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header webservices.h
Library WebServices.lib
DLL WebServices.dll