• Advertisement

Archived

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

directdraw help pls

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

Hi, well I have some pb with the queryinterface function. It always fails void Screen::Create(LPGUID guid) { LPDIRECTDRAW TempDD; //guid = NULL default device if (FAILED(DirectDrawCreate(guid, &TempDD, NULL))) exit(0); if (FAILED(TempDD->QueryInterface(IID_IDirectDraw4, (void**) &lpDD))) exit(0); TempDD->Release(); } in my Screen class I have this public declaration : LPDIRECTDRAW4 lpDD; I include ddraw.h and linking with libddraw.a and dxguid.lib what s wrong ?? Regards, Cho

Share this post


Link to post
Share on other sites
Advertisement
There doesn''t appear to be anything immediately wrong with that code. Assuming:

a) The GUID you pass in to the create function. Did this GUID come from a DirectDrawEnumerate() ? - is so, you must ensure you save the whole of the GUID structure to some "safe" memory and pass a pointer to that (saving the LPGUID from the enumeration isn''t good enough).

b) Also assuming IID_IDirectDraw4 is supported by the version of the DirectX runtime you have installed.


What do you mean by "It always fails" ? Could you be a little bit more specific. In particular what are the return codes from the DirectDrawCreate() and the QueryInterface() calls ?



--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Thx, but it was a dumb mistake

Linking with confliting lib (ver7 and 8)

I''m stupid, sorry

Share this post


Link to post
Share on other sites

  • Advertisement