I hit exactly the same problem

I recompiled an emulator I wrote 2 years ago that used DirectX 7 and now it won't run after compile??

The only differences are that I am using the DX9 headers and have DX9 installed on XP. Can I not use DX7 interfaces with DX9? Or is there a problem with the headers?