I can find only one reference to your undeclared constant:
prompt$ pwd
<other path components>/Microsoft DirectX 9.0 SDK (Summer 2004)
prompt$ find Include/ -name \*.h -exec grep IID_IDirect3D3 {} /dev/null \;
Include/d3d.h:DEFINE_GUID( IID_IDirect3D3, 0xbb223240,0xe72b,0x11d0,0xa9,0xb4,0x00,0xaa,0x00,0xc0,0x99,0x3e);
This tells me you need to find that missing d3d.h file to proceed, but I could be wrong.