Daniel Pantea - 2016-08-21

I needed a way to view CString faster in the debugger and made this small "win32++-cstring-visualizer.natvis" (it's inspired from "stl.natvis" and it should be copied to "Microsoft Visual Studio 14.0\Common7\Packages\Debugger\Visualizers" folder):

<?xml version="1.0" encoding="utf-8"?> 
<!-- to be put in ...\Microsoft Visual Studio 14.0\Common7\Packages\Debugger\Visualizers\ -->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> 

  <!-- VC 2015 -->
  <Type Name="Win32xx::CString">
      <DisplayString Condition="m_str._Mypair._Myval2._Myres &gt;= m_str._Mypair._Myval2._BUF_SIZE">{m_str._Mypair._Myval2._Bx._Ptr,su}</DisplayString>
      <DisplayString Condition="m_str._Mypair._Myval2._Myres &lt;= m_str._Mypair._Myval2._BUF_SIZE">{m_str._Mypair._Myval2._Bx._Buf,su}</DisplayString>
  </Type>

</AutoVisualizer> 

Maybe it helps somebody...

 

Last edit: Daniel Pantea 2016-08-21