请输入您要查询的百科知识:

 

词条 RETAILMSG
释义

MSDN中解释

This macro conditionally outputs a printf-style formatted message.

RETAILMSG (

Expression,

Message

)

Parameters

Expression Boolean expression used to determine if the message would be output. Message Expression to be printed using printf format style.Return Values

None.

Remarks

Theprintf-style message parameter is output if the Boolean input expression evaluates to TRUE. Note that the parameter Message must be enclosed by parentheses to prevent syntax errors being generated by the preprocessor. This macro should be used sparingly, as it increases the size of retail builds.

Example

代码RETAILMSG(TRUE, (TEXT("Testing item count against maximum %u\\r\"),

dwMaxNumberOfItems));

RETAILMSG(dwCurrentNumberOfItems >=dwMaxNumberOfItems,

(TEXT("Invalid item count! Found %u, expected less than %u\\r\"),

dwCurrentNumberOfItems, dwMaxNumberOfItems));

Output

Testing item count against maximum 68

Invalid item count!Found 343, expected less than 68

Requirements

OS Versions: Windows CE OS 2.10 and later

Header: Dbgapi.h

Link Library: none

注意问题

#ifdef DEBUG

RETAILMSG(1,(TEXT("Receive a packet\\t\")));

#endif; 使用RETAILMSG宏时,应注意一个问题:

由于RETAILMSG需要Unicode类型的字符串,所以使用的时候应该这样写

RETAILMSG(1,(TEXT("%s\"),TEXT("Your str")));

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/2/27 20:44:41