Handles an assertion failure in a debug build. DbgAssert will display a message box that includes the condition text, source file name, and source line number. The user will be given the choice to ignore the assertion failure, debug the assertion, or force the application to exit. Thus DbgAssert might return to the caller, depending on the user's actions.

void WINAPI DbgAssert(
const TCHAR *pCondition,
const TCHAR *pFileName,
INT iLine);


  • pCondition
    Pointer to a string version of a Boolean expression.
  • pFileName
    Pointer to a source file name.
  • iLine
    Line number within the source file.


This function is available only in a debug build. Usually, DbgAssert will be called by macros such as ASSERT, not directly from other code.

If you use the ASSERT macro, DbgAssert might display a message box. If this is not acceptable in your environment, you can use DbgKernelAssert instead.

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.