Natvis FourCC visualisation syntax

280 Views Asked by At

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, e.g. {(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?

2

There are 2 best solutions below

0
On BEST ANSWER

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

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

0
On

It needs to be the & HTML entity