Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This macro asserts an expression and produces a DebugBreak if the expression is FALSE.
DEBUGCHK (Expression)
Parameters
- Expression
Boolean value that determines when DebugBreak is called.
Return Values
None.
Remarks
This macro may be used to check the value of a Boolean expression and produce a DebugBreak if the expression evaluates FALSE.
This code causes DebugBreak to allow you to examine the situation in a debugger if the expression evaluates to FALSE. This macro also prints a debug message with the file name and line number where the assertion failed.
Call this macro to validate invariants in your code. For example:
DEBUGCHK(dwCurrentNumberOfItems < dwMaxNumberOfItems);
Will print output like this:
MyProgram: DEBUGCHK failed in file C:\WINCE500\Programs\MyProgram\.\main.c at line 31
This assertion is only present in Debug and builds; it does nothing on Retail and ship builds.
Calling this macro assumes that a global variable dpCurSettings has already been defined, where dpCurSettings must be a DBGPARAM structure. Use ASSERT within modules that do not define dpCurSettings, and DEBUGCHK within modules that do define dpCurSettings.
Requirements
OS Versions: Windows CE OS 2.10 and later
Header: Dbgapi.h
Link Library: none
See Also
DEBUGMSG | ERRORMSG | RETAILMSG
Send Feedback on this topic to the authors