Posted on 2008-11-13 10:11
chefZ 阅读(645)
评论(0) 编辑 收藏 引用
Automatically showing wxStrings contents in debug windows
If you are debugging your program, wxString variables show up in the debug windows in the form:
[+] Variable {...}
You
first have to click on the [+] sign to expand the structure. Then you
see the m_pchData variable, which is the pointer to the actual data.
I found this to be annoying and looked for a solution. There is a very interesting file called AUTOEXP.DAT, which does exactly what I wanted.
- Locate and open a file called AUTOEXP.DAT. Its in the \Program Files\Microsoft Visual Studio\Common\MSDev98\Bin directory, if you are using Version 6. Search for it if you are using .NET Studio.
- Add
the following line to the [autoexpand] section (or the bottom of the
file). With .NET 2003 be careful not to put it in the [hresult]
section!:
wxString=<m_pchData,st>
- Restart Visual Studio.
That’s all. Now, when you are debugging and displaying a string, the wxString variable shows up in the form:
[+] Variable {“Contents of the string”}
This
will save you many mouseclicks, especially when you want to watch the
changes to this variable. And while you are at it, read the comments in
AUTOEXP.DAT. I am sure you can think of more
variables you’d like to handle this way.
While you are at it editing autoexp.dat...