Author Archives: Ofek Shilon

Naming threads

There is a nice feature that is all but undocumented, and has next to no web presence too:  you can give your threads meaningful names. While this is trivial in managed code, it is hardly obvious for native.  The TIB … Continue reading

Posted in Debugging, Visual Studio | 1 Comment

Debugging Native Memory Leaks, Part 1: LeakDiag

Leaking memory is probably the single most painful aspect of native code – its the reason managed was ever born. At work, our code routes ‘new’ calls through_aligned_malloc_dbg. This CRT API, along with cousins like _malloc_dbg and _calloc_dbg, takes extra … Continue reading

Posted in Debugging | 12 Comments

Stepping Over Unwanted Functions

There’s an undocumented VS setting that lets you specify functions that would not be stepped into when you click F11.  This can be save quite a few clicks in situations of the form – Where pressing F11 would repeatedly step … Continue reading

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

Debugging a Process Launch

While this is hardly a hidden setting, I found myself spending too much time to find it twice already – the msdn page describing it appears low on search results, since it uses very different terminology.  So,  if only for … Continue reading

Posted in Debugging, Visual Studio | Leave a comment

Extending Error Codes – to DirectX and Beyond.

$err,hr is quite useful as is, but it only knows how to interpret built-in error codes. Happily, there is an easy way to extend it, via a section in autoexp. All it takes is adding lines of the form – … Continue reading

Posted in Debugging, Visual Studio | Leave a comment

Watching Errors in Visual Studio

System and COM routines often set an error code, that can be retrieved by GetLastError.   There are several ways to decipher this code – (1) Use the command line net helpmsg, (2) From the VS menu, select Tools/Error Lookup … Continue reading

Posted in Debugging | 2 Comments

EnumDisplayMonitors Troubles – NvCpl solutions.

Recently I had EnumDisplayMonitors presenting some strange behaviour, exposing 2 monitors when in fact only one was connected. The nVidia Control panel API eventually came to the rescue – it exposes the entire functionality available via the nVidia control panel, … Continue reading

Posted in Win32 | Leave a comment

Movies Trouble in PowerPoint

(Note: most of this post avoids developer jargon, in hope of being useful to all users) Did you ever give a media-rich presentation, and had to sheepishly apologize to the audience when some movies just wouldn’t play?    Did you ever … Continue reading

Posted in MS Office | Tagged , | 16 Comments

2D Matrix Watch – Introducing autoexp.dat

Deep inside your VS installation (%VS installation%\Common7\Packages\Debugger), hides a bag of goodies called autoexp.dat. It is only semi-official, and almost entirely undocumented. Andy Pennell confesses its his fault,  but I suspect there’s more to it.  Admittedly, its still (as of … Continue reading

Posted in Debugging, Visual Studio | 4 Comments

Resolving linker warning LNK4221

While cleaning up code warnings I came across LNK4221: “xxx.obj: no public symbols found; archive member will be inaccessible.”. The message does point out the culprit obj file, but not much more. both the documentation and a knowledge base article … Continue reading

Posted in VC++ | Tagged | 2 Comments