0

I am trying to use the .natvis file for Visual Studio 2012 to display a customised class in the Watch window but I cannot get it to display.

If I have this structure

namespace a {
    namespace b {
        template<class T, class myClass, class myOtherclass> class hereBeDragons;
    }

    typedef b::hereBeDragons<firstParam, secondParam, thirdParam> IWantToSeeThis;
}

and I want to display objects of the class IWantToSeeThis. What is the syntax I need to use?

I have tried these:

  <Type Name="a::IWantToSeeThis">
    <DisplayString> Here are my values </DisplayString>
  </Type>

  <Type Name="a::b::hereBeDragons">
    <DisplayString> Here are my values </DisplayString>
  </Type>

  <Type Name="a::b::hereBeDragons&at;&bt;&ct">
    <DisplayString> Here are my values </DisplayString>
  </Type>   

<Type Name="a::IWantToSeeThis&at;&bt;&ct;">
    <DisplayString> Here are my values</DisplayString>
</Type>   

but none of them see to cause the structure to be displayed.

I have tried enabling the diagnostics by creating the registry key as explained here:

https://code.msdn.microsoft.com/Writing-type-visualizers-2eae77a2

But when I restarted dev studio no diagnostics were displayed in the output window.

Stefan
  • 3,669
  • 2
  • 32
  • 43

1 Answers1

0

I have worked it out:

<Type Name="a::b::hereBeDragons&lt;*,*,*&gt;">
<DisplayString>
Here are my values
</DisplayString>
</Type>
Stefan
  • 3,669
  • 2
  • 32
  • 43