How to get a programmable interface to the Visual Studio Call Stack window?

青春壹個敷衍的年華 提交于 2020-01-23 02:56:19

问题


I am working on a Visual Studio add-in (part of the ILSpy open source project) and I want to get information about the currently selected stack frame in the Visual Studio Call Stack window.

I tried this:

var callstackWindow = ((EnvDTE80.DTE2)GetGlobalService(typeof(EnvDTE.DTE))).ToolWindows.GetToolWindow("Call Stack");

However it throws an exception when not debugging (and Call Stack window not present) and returns null when the Call Stack window is present.

There is a vsWindowTypeCallStack member in the vsWindowType enumeration, but I can't find any API that uses it. I've searched the EnvDTE documentation without finding any further information.

I'm working in C# with Visual Studio 2013 Professional.

来源:https://stackoverflow.com/questions/36726595/how-to-get-a-programmable-interface-to-the-visual-studio-call-stack-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!