Microsoft DirectX 8.0 |
The Microsoft® DirectShow® base classes provide several macros that perform asserts or cause breakpoints.
Declaration: Wxdebug.h
Macro | Description |
---|---|
ASSERT | Evaluates an expression, and displays a diagnostic message if the expression is FALSE. |
DbgAssertAligned | Tests whether a pointer is aligned to a specified boundary. |
DbgBreak | Displays a message box with the specified string, the name of the source file, and the line number. |
EXECUTE_ASSERT | Evaluates an expression in debug and retail builds. In debug builds, displays a diagnostic message if the expression is FALSE. |
KASSERT | Evaluates an expression, and causes a breakpoint exception if the expression is FALSE. |
KDbgBreak | Causes a breakpoint exception, and logs the specified string. |
Evaluates an expression, and displays a diagnostic message if the expression is FALSE. Ignored in retail builds.
Syntax
ASSERT( cond );
Parameters
- cond
- Expression to evaluate.
Remarks
In debug builds, if the expression is FALSE, this macro displays a message box with the text of the expression, the name of the source file, and the line number. The user can ignore the assertion, enter the debugger, or quit the application.
Example
ASSERT(rtStartTime <= rtEndTime);
Tests whether a pointer is aligned to a specified boundary. If not, this macro invokes the ASSERT macro. Ignored in retail builds.
Syntax
DbgAssertAligned( ptr, alignment );
Parameters
- ptr
- Pointer variable.
- alignment
- Required alignment.
Displays a message box with the specified string, the name of the source file, and the line number. The user can ignore the message, enter the debugger, or quit the application. Ignored in retail builds.
Syntax
DbgBreak( strLiteral );
Parameters
- strLiteral
- Text string.
Example
DbgBreak("Unrecoverable error occurred.");
Evaluates an expression in debug and retail builds. In debug builds, displays a diagnostic message if the expression is FALSE.
Syntax
EXECUTE_ASSERT( cond );
Parameters
- cond
- Expression to evaluate.
Remarks
Unlike the ASSERT macro, this macro evaluates the expression in retail builds. In debug builds, if the expression is FALSE, the macro displays a message box with the text of the expression, the name of the source file, and the line number. The user can ignore the assertion, enter the debugger, or quit the application.
Evaluates an expression, and causes a breakpoint exception if the expression is FALSE. The text of the expression, the name of the source file, and the line number are logged using the DbgLog macro. Ignored in retail builds.
Syntax
KASSERT( cond );
Parameters
- cond
- Expression to evaluate.
Remarks
Unlike the ASSERT and EXECUTE_ASSERT macros, this macro does not display a message box prompting the user. In debug builds, if the expression is FALSE, the macro automatically causes a breakpoint exception to occur.
Causes a breakpoint exception, and logs the specified string using the DbgLog macro. Ignored in retail builds.
Syntax
KDbgBreak( strLiteral );
Parameters
- strLiteral
- Text string.
Remarks
Unlike the DbgBreak macro, this macro does not display a message box prompting the user. In debug builds, it automatically causes a breakpoint exception to occur.