I'm so sorry if this is in the wrong section.
My problem is that this line of code keeps failing:
d3d = Direct3DCreate9 ( D3D_SDK_VERSION );
if ( !d3d )
MessageBox ( hWnd, L"CGraphics::Initialize failed on Direct3DCreate9() ", L"Error!" , NULL );
if this helps solve the problem, this is inside a function of a class, and the original definition of d3d is also in that class, which I coded so:
I keep getting my failure message box, and I cannot figure out why it keeps failing. I have searched the internet, and my initialization method appears to be the same as all the others that I have seen.
Check that you have DirectX version 9.0c(use DxDiag). If you do, then make sure the versions of the DirectX header files you are using match the library files you are linking against(d3d9.h/d3d9.lib), which means they should both be from the same SDK package(you'll probably want the DirectX SDK August 2009 version).
If that doesn't help, then see if other DX9 applications also fail, in which case reinstalling DirectX 9 or the video card drivers might work.