Archived

This topic is now archived and is closed to further replies.

Holy Fuzz

A very stupid question from a very stupid newbie. ;-)

Recommended Posts

All right, I''''m having the most basic of basic problems: Getting DirectDraw to work. Or, more precisely, querying for the version 7 of DirectDraw (actually, I can''t query for ANY version, but 7 is what I want). I have added #include to my application, and I have added ddraw.lib to my project (there isn''t a special folder this is supposed to be in, is there?). I am running MS Visual C++ 6.0 and I have the DirectX 8 SDK installed. I have even taken the liberty of moving the include directory in the SDK to the top of my directory list in MSVC++. Here''s my code: ***** // Direct Draw Interfaces LPDIRECTDRAW lpdd = NULL; //stupid icky version 1.0 LPDIRECTDRAW7 lpdd7 = NULL; //much cooler version 7.0 // Create interface for v1.0 DD. if(FAILED(DirectDrawCreate(NULL, &lpdd, NULL))) return false; // Query for DD v7.0 if(FAILED(lpdd->QueryInterface(IID_IDirectDraw7, (LPVOID *)&lpdd7))) return false; ***** Assume everything works, except for that I recieve the following error message when I try to compile: ***** --------------------Configuration: TankTreader - Win32 Debug-------------------- Linking... main.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7 Debug/TankTreader.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. TankTreader.exe - 2 error(s), 0 warning(s) ***** I can''t for the life of me figure out what''s wrong. Thanks for any help! - Fuzz

Share this post


Link to post
Share on other sites
Hi,

I had similar trouble getting dx7/dx8 to work. Eventually after reading 3 books and microsofts website I found the answer. You need to include another library file, it''s called DXGUID.LIB and it should be in the same directory as ddraw.lib.

iangers.

Share this post


Link to post
Share on other sites
DirectDrawCreateEx eliminates the need to query and use an old IDirectDraw interface. MS reccommends that you use DirectDrawCreateEx. Since they made the software, I''d advise taking their advice. You still need to include dxguid.lib either way, as it contains the defines for the IIDs of the interfaces.

Share this post


Link to post
Share on other sites