Share via


ERRORMSG (Windows Embedded CE 6.0)

1/6/2010

This macro outputs an error message.

Syntax

#define ERRORMSG(
  cond,
  printf_exp
)

Parameters

  • cond
    Boolean expression used to determine if the message would be output.
  • printf_exp
    Expression to be printed using printf format style.

Return Value

None.

Remarks

This macro is very similar to RETAILMSG, except that the ERRORMSG macro prefixes the message with "ERROR", and gives the file name and line number of the error.

Example

ERRORMSG(dwCurrentNumberOfItems >= dwMaxNumberOfItems,
          (TEXT("Invalid item count! Found %u, expected less than %u\r\n"),
           dwCurrentNumberOfItems, dwMaxNumberOfItems));

Output:

 ERROR: C:\WINCE500\Programs\MyProgram\.\main.c line 44: 
 Invalid item count! Found 13343, expected less than 68

Requirements

Header dbgapi.h
Windows Embedded CE Windows CE 2.10 and later

See Also

Reference

Debugging Macros
DEBUGMSG
RETAILMSG
NKDbgPrintfW