• Advertisement

Archived

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

CoCreateInstance() problem.

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

I''m using the Tricks Of The Windows Game Programming Gurus to learn DirectX and I''m trying to initialize DirectDraw4 with CoCreateInstance, but I''m getting a mind boggling error.
if(FAILED(CoCreateInstance(&CLSID_DirectDraw, NULL, CLSCTX_ALL, IID_IDirectDraw4, &lpdd4)))
		MessageBox(hWnd, "Failed to create DirectDraw object!", "DX Init Error.", MB_OK | MB_ICONEXCLAMATION);
 
Generates "cannot convert from ''const struct _GUID *'' to ''const struct _GUID" I''ve tryed casting it, but to what? ... Nothing I tried works. Am I just missing something painfully obvious? I know only that which I know, but I do not know what I know.

Share this post


Link to post
Share on other sites
Advertisement
Remove the ampersand from the first parameter. Cast the 5th parameter as LPVOID*.

Share this post


Link to post
Share on other sites
I keep getting the same error...even in the following.


if(FAILED(lpdd->QueryInterface(IID_IDirectDraw4, &lpdd4)))
MessageBox(hWnd, "Failed to create the DirectDraw4 object!", "DX Init Error.", MB_OK | MB_ICONEXCLAMATION);


It still won''t let me pass the IID_IDirectDraw4 GUID.

I know only that which I know, but I do not know what I know.

Share this post


Link to post
Share on other sites
Now all the previous code will compile... but I'm getting unresolved external on _IID_IDirectDraw4. I've got the ddraw.lib added to the link settings. Could it be that I'm using the DX8SDK?

I know only that which I know, but I do not know what I know.

[edited by - Daishi on June 8, 2002 3:16:35 PM]

Share this post


Link to post
Share on other sites
A search won''t help me much when the DXSDK installer installed corrupted files. A reinstall of the SDK and everything compiles and links fine.

I know only that which I know, but I do not know what I know.

Share this post


Link to post
Share on other sites

  • Advertisement