1

I'm trying to write to a custom Output Window Pane, but the only examples that I can find for writing to the output window automatically write to the Debug pane. I've gotten as far as creating a custom pane with a VS add-in in C#, and writing text to it when VS2010 starts up. I'm working in a C++ project, and I'm just wondering how I can write to my custom pane from anywhere in code. I'd like to do it with as little overhead as possible, because I am working in a larger code base that I don't want to have to heavily modify.

Thanks

4

1 に答える 1

0

[デバッグ] ペインには、OutputDebugString 呼び出し (直接またはDebug.WriteLine/によるTrace.WriteLine) の結果が表示されます (SysInternals からの呼び出しと同じ目的を果たしますdbgview.exe)。これは IDE のデフォルトの動作です。カスタム ペインに書き込むには、Visual Studio 用の独自の拡張機能を実装する必要があると思います。

回避策として、 を使用しdbgview、特定のプレフィックス ( [MODULE-A]: 、 [MODULE-B]: など) を定義し、フィルタを設定して特定の単語の出現を強調表示することができます。dbgview は、IDE なしでプログラムを実行した場合にのみ正しく機能することに注意してください。

于 2013-01-29T13:43:36.843 に答える