DXTRACE_ERR_MSGBOX

Displays a message box with error information.

#define DXTRACE_ERR_MSGBOX(str,hr) 

Parameters

str
[in] Type is char*. Pointer to a string to be displayed in the message box.
hr
[in] Type is HRESULT. HRESULT containing an error code. This value will be passed to DXGetErrorString and converted to the equivalent name.

Return Values

Returns the HRESULT that was assigned to hr.

Remarks

For debug builds, the macro will display an error message that looks similar to the following:

c:\basichlsl\basichlsl.cpp(242):
    D3DXCreateFont( pd3dDevice, 15, 0, FW_BOLD, 1, FALSE, DEFAULT_CHARSET,
    OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, L"Arial",
    NULL ) hr=D3DERR_INVALIDCALL (0x8876086c)

If you are using the Visual Studio .NET debugger, you can jump to the line of source code where the error occurred by double-clicking this message in the debug output window.

If you don't want to use a message box to debug, you can send error messages to the debug output window in Visual Studio .NET using DXTRACE_ERR or DXTRACE_MSG.