Jump to content
  • Advertisement

Archived

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

Fredrik Hellman

IDirectDraw7::Initialize error

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

Hello! When I call lpDD->Initialize(NULL) in this code, an access violation error or an error in ddhelp occur. (I dunno what ddhelp is) What can be wrong? CODE ---- LPDIRECTDRAW7 lpDD; hResult = CoInitialize(NULL); if(hResult != S_OK) { return ERROR; } hResult = CoCreateInstance(CLSID_DirectDraw, NULL, CLSCTX_ALL, IID_IDirectDraw7, (LPVOID*)&lpDD); if(hResult != S_OK) { return ERROR; } hResult = lpDD->Initialize(NULL); // <- Here is the error if(fel != DD_OK) { return ERROR; } END Earlier, I used DirectDrawCreate, but I got the same error. Thank you! mrhellman@telia.com Fredrik Hellman mrhellman@telia.com

Share this post


Link to post
Share on other sites
Advertisement
ddhelp.exe is a helper application started up by ddraw when your app starts up. It takes care of restoring the original desktop mode and cleaning up other resources when your app exits (or crashes).

I encountered a similar error a while back, but a reboot solved it. Have you rebooted your machine?

Also, access violations usually indicate you are trying access data or call a function through a NULL pointer. I know you are checking for S_OK when you call CoCreateInstance, but from what I understand that is not the best thing to do. Try wrapping all of your COM calls in a FAILED macro (including DX calls) instead of checking for DD_OK or S_OK.

From the code you''ve posted (which looks good aside from the fel variable that comes out of nowhere ) it''s the only thing I can think of.

GamesToGO: The Console Gamer''s Paradise

Share this post


Link to post
Share on other sites
Thank you!

Hehe, fel. Fel means error in Swedish. I was translating the code before posint it :-)

I have rebooted my machine several times, and I always get the same error :-(. Yesterday night, I was checking the harddisk with scandisk. I found some crosslinked clusters in the windows\system directory. :-) Oops.

I will test the failed macro, and hope it works.

Thanks!

Fredrik Hellman
mrhellman@telia.com

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!