# IID_IDirectDraw7 Help!!

## Recommended Posts

edimundi    122
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 on other sites
mikedoty    186
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 on other sites
S1CA    1418
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.