DXTRACE_ERR
Microsoft DirectX 9.0 SDK Update (October 2004)

DXTRACE_ERR Macro


Output a debug message and the failed return value for a failed function call.

Syntax

HRESULT DXTRACE_ERR(


    char *str,     HRESULT hr );

Parameters

str
[in] Pointer to a string to be passed to the debugger.
hr
[in] HRESULT containing an error code. This value will be passed to DXGetErrorString9 and converted to the equivalent name.

Return Value

Returns the HRESULT that was assigned to hr.



Remarks

For example, if you call DXTRACE_ERR with:

    DXTRACE_ERR( "Call failed", D3DERR_INVALIDCALL ) 

A function call that fails will output a debug message in the output window of the compiler similar to this one:

    c:\basichlsl\basichlsl.cpp(242): Call failed hr=D3DERR_INVALIDCALL (0x8876086c)

This identifies the file and line number of the function call that fails. You must be running a debug build to see the message. If you are using the Microsoft Visual Studio .NET debugger, you can jump to the line of source code where the error occurred by double-clicking on this message in the debug output window.

If you are not interested in returning the error code, see DXTRACE_MSG.

Macro Information

Headerdxerr9.h
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.