How can I show a wide string simply as a string?

1 week ago 10
ARTICLE AD BOX

This is the situation as I'm seeing it in my watch-window:

Watch-window output

I'd like to see only the string "AutoOutput", not the pointer value (in case I need it, I might always disable the corresponding natvis entry).

What is the corresponding natvis entry?

I already tried the following ones:

<Type Name="wchar_t"> <Type Name="wchar_t[256]"> <Type Name="wchar_t[]"> <Type Name="wchar_t*"> <Type Name="TCHAR"> <Type Name="TCHAR[]">

but none of them work.

This is how the whole thing is defined:

TCHAR m_sz...Name[256]{}; ... typedef WCHAR TCHAR, *PTCHAR;

My idea is to simply add the following entry in the natvis file:

<Type Name="..."> <DisplayString>"{{value}}"</DisplayString> <!-- Shows the string content --> </Type>

Does anybody know the type name I need to use for this?

Alan Birtles's user avatar

Alan Birtles

38.3k4 gold badges39 silver badges73 bronze badges

Dominique's user avatar

Read Entire Article