• Advertisement

Archived

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

ddraw + msvc++ 7

This topic is 5038 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Lelo, ive receive an error while compiling these two lines: LPDIRECTDRAW7 lpDD7; DirectDrawCreateEx( NULL, &lpDD7, IID_IDIRECTDRAW7, NULL ); ( simply rewritten from msdn ) the error is: source.cpp(86): error C2065: ''IID_IDIRECTDRAW7'' : undeclared identifier so i assume that i should include some proper header ( i included ddraw.h only and linked ddraw.lib ) but which one? Please help

Share this post


Link to post
Share on other sites
Advertisement
try linking with ddraw7.dll ?

I haven''t touched dx7 in years, but if i''m not mistaken the old interfaces aren''t available when a higher version is defined, and the DX8 libraries ship with vc 7.

Share this post


Link to post
Share on other sites
yeah but linking libraries does not give anything, error is during compile not linking time ( actually even if i use eg #pragma comment( lib, "shit.lib" ) i receive only error about that that unfortunate IID_IDIRECTDRAW7 ) must be something else... but what?

Share this post


Link to post
Share on other sites
Some rules of thumb for trying to get DirectDraw to work in SDK7...

Dont''t forget to include...

#include INITGUID

...right at the start of your code. This is very important!

Also - if you''re using Visual C++ - don''t forget to add "Winmm.lib", "DDraw.lib" to the project.

As for the code you''ve used, try this as well...

DirectDrawCreateEx(NULL, (LPVOID*)&lpDD, IID_IDirectDraw7, NULL);

...one of these are bound to solve the problem. If not - post back.

Share this post


Link to post
Share on other sites
ok it works!! i wrote:

DirectDrawCreate( NULL, &lpDD, NULL );

lpDD->QueryInterface( IID_IDirectDraw7, ( void** )&lpDD7 );

and it works ( hope that it has exactly the same result as previous

THANK YOU GUYS

Share this post


Link to post
Share on other sites
Hmm...I don''t see any problem using ->QueryInterface() to init DirectDraw7.

Although, be warned - the D7 SDK docs say that if you want to use DirectDraw alongside Direct3D, it recommends using the DirectDrawCreateEx() function insted. My advice is to use it just to be on the safe side...



Share this post


Link to post
Share on other sites

  • Advertisement