RETAILMSG,Expression Boolean expression used to determine if the 来自message would be output. Message Expression to be printed using printf format style.Return Values
MSDN宁夜采首钟中解释
This macro conditionally outputs a printf-st来自yle formatted message.
RETAILMSG (
Expression,
Message
)
Pa陈刚就达rameters
Expression Boolean expression us耐句苏而ed 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 t360百科he parameter Message must b马船语e enclosed by parentheses to prevent synta点苗座重么木训菜合令记x errors being generated by the preproces蒸执sor. 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\编曲游草宁n"),
dwMaxNumberOfItems));
RETAILMSG(dwCurrentNumberOfItems >=dwMaxNumberOfItems,
月较延其息价坐紧许括鲜(TEXT("In然终valid item cou顶把肉式呀法敌房微从nt! Found %u, expected less than %u\r\n"),
dwC测证分顶觉洋皇笔既甲urrentNumberOfItems, dwMaxNumberOfI属第刚tems));
Output
Testing item count against maximum 68
Invalid item count!Found 343, expected less th载计吧收原穿目外飞an 68
Requirements
OS Versions: Windows CE OS 娘握2.10 and later
Header: Dbgapi.h
Link Library: none
注意问题
#i倍境fdef DEBUG
RETAILMSG(1,(TEXT("Receive a packet\t\n")))今紧组班;
#endif; 使用RETAILMS江诉叫城围露G宏时,应注意一个问题:
由于RETAILMSG需要Unicode类型的字符串,所以使用的时候应该这样写
RETAILM水鲜育粒款化解印SG(1,(TEXT("%s\n"),TEXT("Your str")));