VS2015 Visualiser, (* .natvis) DisplayString calls a function to display the value

I have a complex class (MyClass) that has a ToString () function, the function returns a string representation of the string.

I would like the visual studio visualizer to use this function to display a variable

This is my visualizer,

<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
  <Type Name="MyClass">
    <DisplayString>...</DisplayString> 
  </Type>
</AutoVisualizer>

If i use

...
  <DisplayString>{ToString}</DisplayString> 
...

The address of the function is returned, is it possible to display the result of the function?

If not, what would be the best way to display a string representation of a class?

+4
source share
1 answer

Unable to call methods.

From MSDN Forums :

. , ( , , ). ++ funceval

+2

Source: https://habr.com/ru/post/1618675/


All Articles