DXGetErrorString9
Microsoft DirectX 9.0 SDK Update (October 2004)

DXGetErrorString9 Function


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

Syntax

TCHAR *DXGetErrorString9(      

    HRESULT hr );

Parameters

hr
[in] Any HRESULT return code from Microsoft Direct3D, Microsoft DirectPlay, Microsoft DirectMusic, Microsoft DirectSound, Microsoft DirectInput, and Microsoft DirectShow.

Return Value

If successful, this function returns a pointer to a string that contains the name of the error code. If Unicode is set, DXGetErrorString9 will return a Unicode string. Otherwise, it will return an ANSI string.



Remarks

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

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

This method handles all DirectX components including: Direct3D, DirectInput, DirectSound, DirectMusic, DirectShow, DirectPlay, and standard Win32 errors.

This function supports Unicode and ANSI strings.

This function supports Win32 Winerror.h error codes.

Function Information

Headerdxerr9.h
Import librarydxerr9.lib
Minimum operating systems Windows 98


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.