Microsoft DirectX 8.1 (C++)

DXGetErrorString8

Returns the name associated with a Microsoft® DirectX® error code. This method is designed to handle error codes from all the DirectX components and Win32 functions.

 const TCHAR* DXGetErrorString8(
  HRESULT hr
);

Parameters

hr
[in] HRESULT value returned from a DirectX method. This handles only error codes.

Return Values

If successful, this function returns a pointer to a string that contains the name of the error code. If the function fails, it returns the string Unknown.

Remarks

This function is designed to retrieve the text equivalent of a DirectX error message from a Microsoft Direct3D®, Microsoft® Direct3DX®, Microsoft® DirectPlay®, Microsoft® DirectInput®, Microsoft® DirectMusic®, or Microsoft® DirectSound® method. For example, if you set hr to 0x88760686, DXGetErrorString8 returns D3DERR_DEVICELOST.

If an error code maps to more than one text string, DXGetErrorString8 will return a generic string. For example, there are several DirectX error codes, such as DIERR_OUTOFMEMORY, that indicate that you are out of memory, and all map to the same value. If you set hr to any of these codes, DXGetErrorString8 will return E_OUTOFMEMORY.

This method handles all DirectX components including: D3D, DInput, DSound, DMusic, DShow, DPlay, and standard Win32 errors.

This function supports both Unicode and ANSI strings.

Requirements

  Windows NT/2000/XP: Requires Windows® 2000.
  Windows 98/Me: Requires Windows 98 or later. Available as a redistributable for Windows 98.
  Version: Requires DirectX 8.1.
  Header: Declared in Dxerr8.h.
  Import Library: Use Dxerr8.lib