Well you cannot install an older version of DX over a newer version. This has been true ever since the invention of DX. You can uninstall DX and re-install an earlier version, but this is sugar coating the problem and isn't what you need. Besides if you do that and ever want to take a break and play some games, they will want the newest version of DX9. Also drivers are updated to work with the current version of DX so by downgrading and not downgrading the driver can cause major issues.
How can I remove DX9C (Not the SDK) and reinstall DX9B. That way my DX9B SDK will match my OS DX version. This will solve my problem, right?
Yes. However DX is supposed to be backwards compatible for all versions. This is relatively true down to DX4 or so and then it gets a bit fuzzy. There is not much difference between 8 and 9, 9 and 9c. There are readme files and help files that document the changes. I have an old book about special effects programming that uses DX 8.1 and porting them hasn't been all that difficult.
Also, does that mean the code I am learning is obsolete?
Concentrate on concepts in the book and porting it shouldn't be too hard. Don't discard your book simply because it's older code.
Concepts never get old.
Program for DX9. As I said the differences are minor and really come down to adding a parameter or taking one away from certain DirectX calls. Either version will teach you a lot.
In your opinion am I better to continue programming for DirectX 8.1, or keep plugging away at DX9?
Well 7 is much different than 8, but 8 is much closer to 9 than 7 is 8...if that made sense. The main things that have changed in 9 are certain D3DX COM interfaces. Most of core DirectX has not changed much. 7 is far different than 8 or 9 because I do not think it supports fixed function pipeline shaders through the use of SetTextureStageState() calls. I believe those were introduced in version 8.
I have many game programming books on DX8.1 and 7, but they seem to be so much different (code wise) than DX9.
Your questions are all valid. It's obvious you have fought this thing and actually tried to resolve the issue on your own. We don't mind answering questions when you have shown an effort.
Sorry for all the questions, I'm really getting desperate.
You are not bothering us. This is what the board is all about. We've all been there at one time or another - especially with DirectX. Once you get it though, it really comes down to just learning what interface to use for the task at hand. DirectX is really quite simple and quite easy to use.
I usually figure problems out on my own without bothering others, but this has proved to be impossible for me. I've already wasted three nights screwing with the code and installing and uninstalling. Thanks again!
I've never read the book so I can't comment on it. There is a new book coming out from Frank Luna called Beginning DirectX Game Programming 2nd edition. The web site for it is www.moon-labs.com. I would encourage you to get the first edition which is available at www.amazon.com and when the second one comes out - snatch it as well. Also buy as many books as you can on all aspects of game programming as you will find that you will get a broader understanding by reading different explanations of the same topic from different authors. One book won't answer all your questions and none of them will go as deep as you would like. They are aimed at a general audience of game programmers and it would be impossible to write one book that covered all topics available in great depth. So....get as many as you can afford. I've read over 20 in 6 months and just ordered another book on pixel shaders. So I now have 4 books dedicated to pixel shaders and 3 of my other DX books cover them briefly. I have books on sound, multiplayer, game logic and AI, game engine structure, game physics, calculus, vector math, graphics techniques, C/C++, PHP, HTML, DOS tech refs, Intel tech refs (IA32 and IA64), assembly, operating system design and implementation, and loads more.
PS: The book I am using to learn DX9 (and where i'm getting the uncompilable code) is called 'Beginning Game Programming' by 'Jonathan S. Harbour'.
The more the better.
Don't give up. It's well worth it.