Author Archives: Ofek Shilon

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

std::vector of Aligned Elements

Update: answers to some questions raised below are available in a newer post. Fact (1): Functions cannot accept aligned types by value. That is really a fact of nature, but it can make sense:  the function’s stack frame can be … Continue reading

Posted in VC++ | 12 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

Deleting Folders

RemoveDirectory requires the input folder to be empty. That typically requires repeatedly FileFind’ing the folder contents (either with the MFC wrapper or directly with the Win32 API) and DeleteFile‘ing. Things soon get interesting when you discover you need more code … Continue reading

Posted in Win32 | 4 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

OptimizedMesh DirectX Sample Having Issues With Large Meshes

The DirectX SDK comes with quite a few nice samples, neatly organized in a sample browser. Quoting the documentation from the OptimizedMesh sample: This OptimizedMesh Sample sample demonstrates the different types of meshes D3DX can load and optimize, as well … Continue reading

Posted in DirectX | Leave a comment

Coders at Work

I started reading Coders at Work, and it is just as good as Jeff and Joel say. The Jamie Zawinski chapter is brilliant. Brad Fitzpatrick  – while he may be an exceptional developer, he’s a ‘wow, like, dude!’  kind of … Continue reading

Posted in Design | 1 Comment

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

Duplicate Volume Serial Numbers

We recently released a product version, with yearly licenses attached to the machine’s Volume Serial Number.  Now it is called a ‘serial number’, and it seems as meaningless and as random as a UID (mine is 34EE-10A0), so it must … Continue reading

Posted in Win32 | Leave a comment

Memory Fragmentation Trouble

We recently had some weird issues that turned out to emanate from a failure to allocate a large consecutive chunk of heap memory.  (It was an exceptional pain to nail the cause there – maybe more on that in a … Continue reading

Posted in Win32 | Leave a comment