Um... okay, looks like my initial code was fine too. It seems there is a problem with the Windows 2000 machine I was using as a testbed. I have subsequently tested both versions on other machines running 2000 and both work fine.