Category Archives: Visual Studio

Checking Memory Corruption with _CrtCheckMemory – From the Debugger

Edit: In VS2015+ versions this trick is still useful but is a bit different.

Posted in Debugging, VC++, Visual Studio | 2 Comments

Setting Breakpoints on All Class Methods

In a recent video John Robbins (probably the world’s leading debugging expert) made a public request of his audience: write a VS addin that enables setting function breakpoints by partial name matches. That is, let the user type C*::M* in … Continue reading

Posted in Debugging, VC++, Visual Studio | 2 Comments

Visualizing MFC Containers in autoexp.dat

MFC containers are more or less officially deprecated in favor of STL. Even so, when navigating in legacy code the need often arises to watch CArrays, CLists, CMaps and the like. autoexp.dat provides only STL visualizers out of the box, … Continue reading

Posted in Codeproject, Debugging, Visual Studio | 7 Comments

Playing With Strings

Take the following code: What would you see when watching the resulting strings? Probably not what you expect: This is a simplified version of a much dirtier, very real bug I dealt with recently. Several string and debugger features joined … Continue reading

Posted in VC++, Visual Studio | 6 Comments

Editing Binary Resources with VS

The need occasionally arises to modify binary resources without re-compilation. Say you want to change the manifest-dependencies of a dll you don’t have the source to.  Or you wish to bump up the version of an executable without actually working … Continue reading

Posted in Visual Studio | Leave a comment

Viewing Debugee Environment Variables

Koby asks – “How suitable is VS automation for doing something like printing the values of all environment variables in the debugee process”? In fact, I just learnt how to do that. type ‘$env=0’, either at a watch window or … Continue reading

Posted in Debugging, VC++, Visual Studio | 2 Comments

Breaking on System Functions with the Context Operator

[Edit, Aug 2010:] About a year after this trial-and-error-ish investigation, I accidently found this hidden bit of documentation which pretty much sums it up. The context operator is technically documented, although barely so. Seemed to me the reason is that … Continue reading

Posted in Debugging, Visual Studio | 9 Comments

Sound Alerts on VS Events – Revisited

I started using the sound alerts on a machine with VS2008 express – and I just learnt that this tweak works for VS2003 and VS2008 but not VS2005. Here’s how it (apparently) came about: First, MS deliberately took it out. … Continue reading

Posted in Visual Studio | Leave a comment

Sound alerts on VS events

When a build is more than a few seconds, I often drift off – to either productive or unproductive activity, but anyway into something I must snap out of. So for me personally, the following just discovered tweak can be … Continue reading

Posted in Visual Studio | 1 Comment

Coding Binary as Binary

If you’re comfortable with hex, you have no business in this post.  If on the other hand, when faced with a mask like 0xFFA8 you’re forced – like me – to translate it on paper into 11111111 10101000,  then by … Continue reading

Posted in Codeproject, Debugging, VC++, Visual Studio | Leave a comment