Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectX7

Started by Metus Mar 17, 2000 at 12:59 PM 8 replies 600+ views
Original Post
Metus
Metus
Can someone be so nice and tell me what''s wring with this code: LPDIRECTDRAW7 lpDD; DirectDrawCreate(NULL, &lpDD, NULL); I''ve got this Errormessage: error C2664: ''DirectDrawCreate'' : cannot convert parameter 2 from ''struct IDirectDraw7 ** '' to ''struct IDirectDraw ** '' Im Using Visual C++ 6.0 //Metus
Ethereal
REF_Cracker
REF_Cracker
Try the function
DirectDrawCreateEx
Look it up for syntax!
I had this problem a long time ago when converting my code to the lastest interfaces!
Check out my project @ www.exitearth.com
REF_Cracker
REF_Cracker
Here ya go
DirectDrawCreateEx(pDriverGUID,(VOID**&g_pDD,IID_IDirectDraw7,NULL );
Check out my project @ www.exitearth.com
Metus
Metus
Thnx...
But it seems that the function does not take 3 parameters, and i dont have Dx7 helpfiles....

Trying to d/l it from Microsfot..but that seems impossible

//Metus

Ethereal
fuzzyai
fuzzyai
there're probably other ways, but these two should work:
the first one i've not used, but it's on a DX7 book i have

LPDIRECTDRAW7 lpdd = NULL;
DirectDrawCreateEx(NULL,(LPVOID *)&lpdd,IID_IDirectDraw7,NULL);



or this:

LPDIRECTDRAW lpdd = NULL;
LPDIRECTDRAW7 lpdd7 = NULL;
DirectDrawCreate(NULL,&lpdd,NULL);
lpdd->QueryInterface(IID_IDirectDraw7,(LPVOID *)&lpdd7);

in that last one you create a DD object, and use to to query for a newer version, afterwards you can destroy it, as you have no use for the original anymore.

hopefully this is helpful

Edited by - fuzzyai on 3/17/00 1:18:03 PM
Metus
Metus
Well, the old errormessage disapperad, but a new one came up;
error LNK2001: unresolved external symbol _IID_IDirectDraw7

What does this mean?
I do have DX7 Libs and Headers, and #included

I''m going nuts...

//Metus
Ethereal
fuzzyai
fuzzyai
that''s a very simple problem that drove me insane for about a week..
did you include (not #include, but add to the project) dxguid.lib?
Metus
Metus
Wow...it worked thanks a lot
ONe more thing:
Do you know if i can set some libraries (Like DDraw.lib, DSound.lib, Winmm.lib an further on) as "standard" libraries so i wont need to include them again if i''ll create another project, and stop the riks of forgetting them?

Thanks again
//Metus
Ethereal
fuzzyai
fuzzyai
it would make alot of sense for MSVC++ to give you that kind of option, but if there is one, i don''t know about it..
crazy166
crazy166
yes, you can have "default" libraries (in a way). set the LINK environment variable to point to any libraries you want.

i personally haven''t used this, since it would link ALL subsequent projects to these libraries, but it sounds like it should work.

crazy166

some people think i'm crazy, some people know it

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.