Microsoft DirectX 8.0 (C++)

D3DXGetErrorStringA

Returns the ANSI error string for an HRESULT.

HRESULT D3DXGetErrorStringA(
  HRESULT hr,
  LPSTR pBuffer,
  UINT BufferLen
);

Parameters

hr
[in] The specified HRESULT error code to decipher.
pBuffer
[out] Pointer to the buffer to fill with the ANSI error string.
BufferLen
[in] Number of characters in the buffer. Any error message longer than this length will be truncated.

Return Values

If the function succeeds, the return value is D3D_OK.

If the function fails, the return value can be D3DERR_INVALIDCALL.

Remarks

D3DXGetErrorString maps to either D3DXGetErrorStringA or D3DXGetErrorStringW, depending on the inclusion or exclusion of the #define UNICODE switch. Include or exclude the #define UNICODE switch to specify whether your application expects Unicode or ANSI strings. The following code fragment shows how D3DXGetErrorString is defined.

#ifdef UNICODE
#define D3DXGetErrorString D3DXGetErrorStringW
#else
#define D3DXGetErrorString D3DXGetErrorStringA
#endif

This function interprets all Microsoft® Direct3D® HRESULTS.

Requirements

  Header: Declared in D3dx8core.h.
  Import Library: Use D3dx8.lib.

See Also

D3DXGetErrorStringW