Advertisement

How to use VC++6 and DirectX6?

Started by May 01, 2000 11:56 AM
3 comments, last by monty 24 years, 4 months ago
Hi, Ok, i''m a newbie, really newbie, so... don''t laugh! Where can I find a tutorial for how to put VC++6 and Directx6 working together? When I start a project in VC++ witch type of project should I chose? The thing is I only know how to program in C using "pico" in linux and gcc, so... I can''t find this kind of info anywhere. Thanks in advance! [monty]
[monty]
Hi. I haven't worked with Directx6 (yet), but I've used Directx5 in programs I wrote using VC++6. This is what I did:

(1) When I created a project (by clicking on FILE then NEW then the PROJECTS tab) I selected Win32 Application from the list of project types. I chose to create an empty project, and then added source code files to the project by clicking on PROJECT then ADD TO PROJECT then FILES.

(2) I had to point VC++6 to the Directx inc and lib files by clicking on TOOLS then OPTIONS then the DIRECTORIES tab. There's a box that says "Show Directories for." Select "Include files" in the box, then type the path where ddraw.h, dinput.h, etc, is located on your hard drive. Then select "Library files" in the box and type the path where ddraw.lib, dinput.lib, etc, is located. Make sure that these paths are at the top of the list of paths.

(3) To get my project to work, I also had to do this: click on PROJECT then on SETTINGS then on the LINK tab. In the box that says "Object/library modules" add the following: ddraw.lib, dinput.lib, etc. I also had to add winmm.lib to get mine to work.

I hope this helps you out. If you have any more questions, please feel free to ask.

If you haven't heard about Andre LaMothe's books, he's got a lot of good info about using Directx in programs.



Edited by - Coyote on 5/1/00 1:15:49 PM
Advertisement
All this is assuming you have downloaded the DirectX SDK of course... about 120 MB which took me ages to d/l.

"Born of a Broken Man, but not a broken man."
------------------------------"If a job's worth doing it's worth getting someone else to do it for you....."

I''ve ordered the CD version.

WOW, I''ve done what you sugested, but now I get to many link errors, something about "external object..."

I''d better get a book that explains it all first. Any suggestions?

TIA
[monty]
[monty]
In reference to DavidHerod's comment: That's a good point - one that I forgot to mention. If you don't have the DirectX6 SDK already installed on your hard drive, it won't work.

Also forgot to mention (but you may already know this) that you have to put #include statements at the top of any of your source code files that contain calls to DirectX, like this:

#include "ddraw.h"
#include "dinput.h"
#include "dsound.h"
and so on...

But I don't know if your problem is a coding problem or a compiler set-up problem.

I don't know if it would be of any help, but, if you'd like, I can Email you the source code of an example program that uses DirectDraw (version 5) to plot some pixels on the screen.

Everything I know about DirectX (which, I admit, is not a whole lot) I got from Andre LaMothe's book Tricks of the Windows Game Programming Gurus.

It took me a long time to figure out how to get VC++6 to cooperate with DirectX (and everything else). Keep at it - you'll get it.



Edited by - Coyote on 5/1/00 10:46:04 PM

This topic is closed to new replies.

Advertisement