Sunday, November 27, 2005

Carpal Tunnel

Lately, the carpal tunnel in my right arm has been flaring up. My initial response was to ignore it, which wasn't the greatest option. My new response has been to research it. In this process, I found a cool freeware program called Workrave. It's a little applet that sits in my Windows taskbar and tells me to do things like, "take a microbreak", or "take a long break", which to my understanding, can help reduce Carpal Tunnel Syndrome by quite a bit in the long run. The constant stream of breaks will take a bit of getting used to, given that I usually hate being interrupted when I'm coding and "in the zone", but I don't expect any problems with that.

Now I just need a program that says, "make yourself a sandwich and eat damnit", every now and then, optionally with a "pretzels are not a meal" dialog box.

Thursday, November 10, 2005

A Simple Fix

Turns out the problem I had with setting a window procedure before calling IDirectDraw7::SetDisplayMode had to do with the way the window procedure itself was formed. Originally, I had it set up like this:


LRESULT Application::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)


Once I inserted "CALLBACK" in between "LRESULT" and "Application", everything worked fine. This is how it looks now:


LRESULT CALLBACK Application::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)


The surprising part was that the malformed window proc would work under Win98, however something about the call to IDirectDraw7::SetDisplayMode made it fail.

Wednesday, November 09, 2005

Die, Win98, Die

Win98... has to die. Really. I realize there are people out there who like it, and still use it as a gaming platform. You guys suck. Writing good Windows API code is enough of a pain, writing good Windows 98 code is worse. Case in point: IDirectDraw7::SetDisplayMode seems to like to crash on Win98 if a custom window procedure is set. If the default window procedure (DefWindowProc) is set, it works fine, but try to set a custom wndproc and it dies, under Win98 at least. Doesn't matter if that wndproc does nothing but call DefWindowProc.

Now then, I'm sure there's a perfectly reasonable explanation for why this happens, except I'm lazy, and like things to Just Work(tm). The more time I spend with Win98, the more happy I am to see its userbase shrink. For the casual games market, however, it's probably years away from being dead enough to ignore.

Anyways, if you like video game music, check out Radio GOSU, a good internet radio station which only plays video game music, mostly classic stuff too.