Category Archives: Win32

Entry Point Not Found, and other DLL Loading Problems

Occasionally I come across DLL load problems: The verbosity of the error messages varies greatly. In their raw form these include at least the DLL name, but as various frameworks come into play (for the error message above, it’s .net) … Continue reading

Posted in Debugging, Win32 | 17 Comments

RGB vs. BGR in Bitmaps

What is the channel order in bitmap pixels? Does the R channel occupy the least- or most- significant byte? Ah, the answer to this simple question held me back for nearly a day while debugging some image processing code. MSDN, … Continue reading

Posted in Win32 | Tagged , | 1 Comment

Three F-keys Gotchas

We recently did a small internal app, that had to use all 12 F-keys – which turned out to be surprisingly cumbersome. I hadn’t found this stuff concentrated on a single place, and certainly it could have saved me some … Continue reading

Posted in MFC, Win32 | 4 Comments

Reading Monitor Physical Dimensions, or: Getting the EDID, the Right Way

  Edit: an improvement is published in a separate post We recently needed to know the physical size of monitors on customer machines. Getting it right was a surprisingly tedious research – and definitely something that deserves more web presence … Continue reading

Posted in Win32 | 42 Comments

Breaking on Data Read

Edit: As of windows 10 the details and code below do not work. A working alternative is detailed at a newer post.   You’re probably familiar with Data Breakpoints, and rightfully so: It’s extremely useful to know where a value changes. … Continue reading

Posted in Debugging, VC++, Win32 | 6 Comments

g_dwLastErrorToBreakOn: Watching Errors on VS Revisited

Raymond Chen posted about SetLastError recently, and an interesting discussion ensued. One comment in particular caught my eye: The easiest way to catch a specific last error value in debugger is to set ntdll!g_dwLastErrorToBreakOn to that value. A good while … Continue reading

Posted in Debugging, Win32 | 2 Comments

AfxIsValidAddress (and Others) Don’t Work as Advertised

MFC exposes a some memory debugging facilities such as AfxIsValidAddress, which (for debug builds) supposedly – Tests any memory address to ensure that it is contained entirely within the program’s memory space. Or does it?   AfxIsValidAddress only delegates the call … Continue reading

Posted in MFC, Win32 | Leave a comment