次の方法で共有


DEBUGCHK (Compact 2013)

3/28/2014

This macro asserts an expression and produces a DebugBreak if the expression is FALSE.

Syntax

DEBUGCHK (Expression) 

Parameters

  • Expression
    Boolean value that determines when DebugBreak is called.

Return Value

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 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:\WINCE800\Programs\MyProgram\.\main.c at line 31

This assertion is only present in Debug and Checked builds; it does nothing on Retail and Ship builds.

Calling DEBUGCHK 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.

Requirements

Header

dbgapi.h

See Also

Reference

Debugging Macros
DEBUGMSG
ERRORMSG
RETAILMSG