Advertisement

Help with compiling DX7 stuff

Started by December 15, 1999 08:27 PM
2 comments, last by Koobze 25 years, 2 months ago
The 3rd argument requires a reference rather than a pointer. i.e.

LPDIRECTDRAW7 DirectDraw7Ptr;

if ( FAILED ( DirectDrawCreateEx( NULL, (void**) &DirectDraw7Ptr, IID_IDirectDraw7, NULL ) ) ) {
return false;
} else { return true; }

(Note the & is missing)

On a side not here, I noticed (as I'm sure alot of other folks did) that DX7 added the DirectDrawCreateEx method.

Was this done just to avoid having to use a regular DirectDrawCreate, then querying for a new version of the interface?

How is this better than just biting the bullet and using CoCreateInstance with Initialize? After all, you'll need to to use the COM methods if you want to use DirectMusic anyways, so why not just use them to begin with instead of mixing the two?

Advertisement
Well... i've just written a basic app making a window, and I wanted to make it fullscreen using the directdraw7 object... and i get problems when compiling. (i'm using vc++ 6)
I have the following code:

LPDIRECTDRAW7 DirectDraw7Ptr;

if ( FAILED ( DirectDrawCreateEx( NULL, (void**) &DirectDraw7Ptr, &IID_IDirectDraw7, NULL ) ) ) {
return false;
} else { return true; }

I have included ddraw.h, initguid.h, and the ddraw.lib files. I get this error everytime i compile:

D:\MyProjects\DDraw\DDraw.cpp(111) : error C2664: 'DirectDrawCreateEx' : cannot convert parameter 3 from 'const struct _GUID *' to 'const struct _GUID &'

Could someone please help me? Is there something I've missed?

Thanks for the help
It all works well now... I had originally tried it without the &, but it said unresolved something or other... turns out that copying .h and .lib files over the ones in use by vc++6 doesn't work
Now, I must figure out how to use the fullscreen directdraw with opengl. Should I just use:
HRESULT val = DirectDraw7Surface->GetDC( *hDC );
and then wglMakeCurrent the hDC, then release? I think something is messing up in my code so i'm gonna make a quick little output function to a text file

This topic is closed to new replies.

Advertisement