directdraw help pls
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement