Error Message Function


The Errors.h header file provides a function for getting an error message for a given message identifier in the current language. The same header also provides the MAX_ERROR_TEXT_LEN equate, which indicates the maximum number of characters allowed in a message.
Function Description
AMGetErrorText Gets the error message text for a given message ID.


AMGetErrorText

Retrieves the error message text for a given message identifier in the appropriate language.

DWORD AMGetErrorText(
  HRESULT hr,
  TCHAR *pBuffer,
  DWORD MaxLen
  );

Parameters
hr
Message identifier for the message text to be returned.
pBuffer
Area into which the message text will be stored.
MaxLen
Number of characters that pBuffer points to.
Return Values

Returns the number of characters stored in the buffer, or zero if an error occurred.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.