Skip to main content
gamedev.net
🔒 Locked

Frustrating problem

Started by bitstream Dec 19, 2001 at 11:16 PM 5 replies 650+ views
Original Post
bitstream
bitstream
I''m probably overlooking something stupid but I can''t seem to find it. here''s my problem. I''m trying to comile a small program using DDraw. I''m getting an error on the following lines. LPDIRECTDRAW4 m_lpDirectDraw4; LPDIRECTDRAWSURFACE4 m_lpddPrimary; LPDIRECTDRAWSURFACE4 m_lpddBackBuffer; DDRAWSURFACEDESC4 m_ddsd; I''ve #included the ddraw.h file but VC++ is giving me errors as if it doesnt see the type definitions in the header file. However if I change my code to this it compiles errorless. LPDIRECTDRAW m_lpDirectDraw4; LPDIRECTDRAWSURFACE m_lpddPrimary; LPDIRECTDRAWSURFACE m_lpddBackBuffer; DDRAWSURFACEDESC m_ddsd; BTW those arent the interfaces I want to use. This makes no sense to me. Both ways i''ve listed here should work. What''s even worse I tried to compule Microsofts DDraw samples...got the same thing. Keep in mind I DO have the proper path for the header file. Any thoughts?
valg3
valg3
Have you included the proper *lib files into the linker?
bitstream
bitstream
Yes I have actually but no dice.
GoofProg
GoofProg
You are trying to use a different version of DirectX objects.
LPDIRECTDRAW4 declares a DX5 version of the object
LPDIRECTDRAW declares a DX3 version of the object
You need to call some COM functions to select the correct version.

The nightmare travels across the cosmos with his burning mane.  The trail of ash that is produced. ?Have a nice day!?
bitstream
bitstream
The sample code I gave are only declarations. Making a pointer to the proper COM interface comes later(like in a function). But first thing''s first, I need to have the proper data type to hold the interface pointer. In this case LPDIRECTDRAW4 or 7 or whatever. The typdef for LPDIRECTDRAW4 in the header is
typedef struct IDirectDraw4 FAR *LPDIRECTDRAW4;

So to answer your kind reply, I don''t think that''s it.
But thanks anyway...keep em comin''
scaught
scaught
Is your DirectX SDK directories listed before the Microsoft ones in your include paths? It kinda sorta sounds to me like it''s finding the headers that came with MSVC and not a more recent version....

-scott
bitstream
bitstream
Thanks scaught! That was it. I knew it was something stupid that I was overlooking!

Topic Locked

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

Sign in to reply to this topic.