views:

479

answers:

1

I know a solution would be to use VS 2005 or 2008, but that's not an option at the moment. I am supposed to write an extension to the VS 2003 C++ debugger to improve the way it displays data in the watch window. The main reason I am using a DLL rather than just the basic autoexp.dat functionality is that I want to be able to display things conditionally. I.e. I want to be able to say "If the name member is not an empty string, display name, otherwise display [some other member]"

I can't find much documentation online, either from MS or other people who have used (or tried to use) this part of VS 2003. The MSDN EEaddin sample was an ok start, but very basic and didn't really help me get very far.

So far I am just learning my way around it, learning how to display various types without knowing exactly what kind of types I will be working on in the end.

I have managed (through much trial and error) to get the DLL to display pointer-to-basic-type members, string members, pointer-to-user-defined-type members and auto_ptr<int> members. At the moment I am having trouble displaying vector members and auto_ptr<string> members.

(I found a page that says auto_ptrs are deprecated, but I need to be able to display them properly as they are used in the code my extension is meant for.)

My question is: has anyone done this kind of thing and do you have or know of some helpful documentation on the subject?

Thanks!

[update:] I've worked out why I'm having trouble with the auto_ptr<string> class members. It's because of the way the string class is implemented. It has a char[16] buffer where it stores the data for short strings, and a char* pointer if the string is longer than (15 characters+termination character). I'm not sure whether it's possible and worth trying to hack into that to display longer strings (I can display strings that short enough to be saved in the char[16] buffer)

+5  A: 

This article might help you:

http://msdn.microsoft.com/en-us/library/aa730838(VS.80).aspx

e.tadeu
How did I miss that?! Thank you for the link. I just wish I had asked this question a week ago, before I worked that all out for myself...
Vickster