简体   繁体   中英

Natvis FourCC visualisation syntax

I'm trying to define a .natvis <DisplayString> for a uint32_t type, to show as an array of four characters, which in the Watch window, during debugging, would be expressed a bit like this: (char*)&fourcc,4 .

Unfortunately, natvis doesn't seem to like the & very much - it gets ignored, eg {(char*)&fourcc,4} , {(char*)&{fourcc},4 , {((char*)&)fourcc,4} doesn't work. The documentation does not make it obvious how to perform casts, if it is supported at all.

What am I missing?

Casts are supported, and the syntax is {(char*)&amp;fourcc,4} , ie use the xml entity for '&'.

For best results the na modifier may be used along the array size (ie 4 above) to suppress the showing of the memory address.

必须是&HTML实体

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM