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


directdraw help pls

Recommended Posts

Cho    122
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
S1CA    1418
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

Share this post

Link to post
Share on other sites