• Advertisement
Sign in to follow this  

IID_IDirectDraw7 Help!!

This topic is 4360 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

when i try to compile i get the error LNK2001 : unresolved external symbol _IID_IDirectDraw7. i linked ddraw.lib and dxguid.lib in but it still can't work! i did this : if(FAILED(lpdd->QueryInterface(IID_IDirectDraw7, (VOID**)&lpdd7))) i only need to include ddraw.h right? can someone please help?

Share this post


Link to post
Share on other sites
Advertisement
I use DirectDraw7; this is the code I use to set it up:

if (FAILED(DirectDrawCreateEx(NULL, (VOID **)&lpdd, IID_IDirectDraw7, NULL)))
MessageBox(main_window_handle, "Error", "Could not create DirectDraw Device. Make sure DirectX is installed.", MB_OK);
if (FAILED(lpdd->SetCooperativeLevel(main_window_handle, DDSCL_FULLSCREEN | DDSCL_ALLOWMODEX | DDSCL_ALLOWREBOOT | DDSCL_EXCLUSIVE)))
MessageBox(main_window_handle, "Error", "Could not enter fullscreen mode!", MB_OK);


It compiles for me, and doesn't give me any errors about IID_IDirectDraw7. The only guess I could come up with would be, maybe somehow you are using ddraw.lib from Directx 5 or something? (Earlier than 7 anyway.) Or, maybe it isn't linking properly?

Share this post


Link to post
Share on other sites
Double check the order your compiler is searching paths for library files.

If you're using MSVC 6 without a newer version of the platform SDK, then that only comes with DirectX 5 header and library files.

It's possible that your development environment is set to search the platform SDK paths before the DirectX SDK ones, or worse, not searching the DirectX SDK paths at all.

If you're using MSVC, check the [project] directories under Tools->Options... - the paths for the DirectX INCLUDE and LIB folders should be at the TOP of the lists for both Include and Library file. If they aren't move them to the top and try again.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement