5

For some time now when I am debugging Visual C++ applications and viewing any CString or char* (or any other ascii char based type) variable in the Local, Auto, or Watch debug windows, the CR/LF characters in my variables are not displayed at all.

In other words, if I have a string variable set to "This is a line\r\nThis is another line" in my code, the debug window will show "This is a lineThis is another line". What I would like it to show is "This is a line□□This is another line" so that I can see the two extra characters in that text.

This has caused me to make some mistakes when trying to debug string parsing code. Note, the text visualizer properly breaks the text up into separate lines, but I don't want to use the text visualizer if I don't have to. Furthermore, some coworkers of mine are able to see CR/LF characters in the correct manner, but we cannot determine why they are not shown for me.

Many thanks in advance.

4

3 に答える 3

3

この古いリンクによると、これはある種の再現が難しいバグのようです (2k8 でも見られません) 。

これを適切に行うには、これらの文字に対して適切なエスケープ シーケンスを発行する必要があります。たとえば、文字列に「\r\n」を表示します。特殊文字の削除の動作は歴史的であり、将来のリリースで修正される予定です。改行を含むテキストを表示している場合は、文字列を文字配列として表示できます。長さ 100 の文字列を配列として表示するには、「str,100」と入力します。または、虫めがねのグリフをクリックして、文字列を複数行の編集コントロールで表示することもできます。

一ヶ月後:

この問題は、VS2003 でも VS2005 でも再現できません。これはマシン固有の問題のようです。

したがって、同僚が実際にそれを見ているのであれば、私たちのセットアップで何か奇妙なことが起こっているに違いありません.

于 2009-05-08T04:20:00.850 に答える
0

使用しているフォントでしょうか?全員が同じ (できればデフォルトの) フォントを使用していますか?

私は、それを行う人々に多くの厄介な問題が発生しました。それがあなたの問題かどうかはわかりませんが、確認する必要があります。

于 2009-05-07T19:48:42.280 に答える
0

少なくとも 2008 年に私が見つけた SQL Server の質問への回答として、編集用に 200 行を取得すると \r\n 四角形が表示され、読み取り専用で 1000 行を取得すると表示されません。

于 2011-12-16T14:40:56.823 に答える