Prolific Usage of MiniDumpWriteDump (Automating Crash Dump Analysis Part 0)

As a precursor to a series on programmatically querying crash dump files, I wanted to first talk about the MiniDumpWriteDump function.   You don’t necessarily need to wait for your application to crash in order to generate a memory dump. As soon as you detect something bad happening, you can call MiniDumpWriteDump yourself and generate…

4

StrCmpLogicalA

Due to a policy around supporting and encouraging internationalizable software, there are certain system APIs which only have a UNICODE version (functions typically with the W postfix). One example which is missing the plain old ANSI version is the StrCmpLogicalW function. Unfortunately for me, I was in need of an A version. “Fixing” my code…

1

NULLize the throwing new

Old versions of Microsoft’s C++ compiler supplied a form of the new keyword which would return NULL if the memory allocation failed (to mimic the behavior of malloc). The newer (more C++ compliant) versions of the compiler will instead throw a std::bad_alloc exception on failure. This change has lead to a frequent question on the…


Writing Strings with OLE (CCommand)

This last weekend I was writing a COM object for submitting/editing entries into a SQL Server 2005 database we have for collecting project metrics. To do so, I was using the templated OLE DB functions: CCommand<CDynamicAccessor>, and things were progressing well until I needed to write a string value into a varchar field. The SetValue…


Poor-Man’s Profiler

Microsoft’s C/C++ compiler supports the /Gh and /GH switches, these options allow the developer to inject a function call into the beginning and exit of every procedure being compiled. Aside from enabling some cool logging/traceability scenarios, you can also utilize this functionality to build in a simple profiler.   There have been a (surprisingly large)…


Testing Your PDB Files

Very little attention is often applied to PDB files, but if you do ship them to customers, then you will want to ensure they don’t contain more information than is necessary. The debugging information stored here can be used to reverse engineer or attack your code, so it is worthwhile to take a precautionary step…


Google’s Chart API

Throughout the software development cycle there is a wide array of areas where you need to generate various reports which include nifty looking charts. Whether you are generating performance reports, bug trends, tracking memory or CPU utilization, or following code coverage results; generating a meaningful graph is important for delivering and allowing the easy consumption…


Date/Time Formats and Conversions

In C/Windows land, there are a handful of different formats for storing date and time values. Unfortunately, you often need to convert between them to get something useful done, this also means it is important to know the properties of each format. Here is a cheat sheet for the standard date/time formats with some basic…

1