Macros are evil

I’m innocently developing a device context class for my LFC framework and I want a method called SelectPen. All of a sudden I’m getting very weird linker errors about how SelectPen is not defined.
It turns out that SelectPen is a macro defined in windowsx.h as an alias for SelectObject.
#define SelectPen(hdc, hpen) ((HPEN)SelectObject((hdc), (HGDIOBJ)(HPEN)(hpen))) Very annoying.Very […]

Editing Tracks in Windows Media Player

I recently embarked on a complete overhaul of my digital music library–including re-ripping all of my hundreds of CDs into WMA at 192 Kbps. It took a few weeks to get through  that, and now I’m going through each album “normalizing” it–fixing up names, album artists, composers, etc. It’s quite an effort and very tedious […]

Simple Customization of a Collection Class

I needed a simple array of strings today, and I needed to be able to return it via a property. I could use a simple array, but that has some significant drawbacks. I could use an ArrayList, but the indexer returns an object, which would force the application to always cast it. I decided to […]

What’s the word for…

NPR ran a fun story the other day about coming up with words to express feelings or situations that we don’t have a word for.
My question is: what’s the word for the fear of writing “Love, ” (Like you would maybe automatically do to your spouse) at the end of an e-mail to your boss?
I’m […]

Multiple Choice Tests

The problem with multiple choice/true-false tests is that the more you know, the more answers become “that depends.”

Tags: philosophy

Still No Silver Bullet…

Much is being made lately about vulnerabilities in Mac OS X, and various people are either haughtily dengrating the Mac while others are pooh-poohing the results with bad logic.
All of the ridiculous claims of “My OS is [better | more secure | safer] than your OS” is getting old. All these problems really do is […]

Dear Blockbuster,

Our relationship has been a long one, but at long last the time has come to go our separate ways. I can’t say our relationship has been a happy one. I remember the long nights of walking up and down your aisles, looking in vain for a decent movie, only to return home empty-handed to […]

Creating an Object-Oriented Framework from an existing API

One of my personal goals this year is to go through Petzold’s book on Programming Windows. During that 1500+ page journey I’m creating a framework class library for my personal use while developing Windows applications. This way I can simultaneously learn the intricacies of Win32 while at the same time developing a framework library that […]