• Advertisement

Archived

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

Exception

This topic is 6213 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 there. I`m getting a access violation exception in my code with a DirectDraw4 surface. I`m trying to do this: lpddsprimary->GetPixelFormat(&ddpixel); It throws an exception. I`ve checked all over the palce but I cant figure it out. :-( HELP ! :-( Does anybody want the asm code ? Would that help ? ~V''lion I came, I saw, I got programmers block. ~V''''lion

Share this post


Link to post
Share on other sites
Advertisement
Hmmm. my guess is that your lpddsprimary pointer isnt pointing at what you think it is pointing at. Have you tried stepping though with the debugger, checking the value against the value at creation?

Share this post


Link to post
Share on other sites
Hmmm. my guess is that your lpddsprimary pointer isnt pointing at what you think it is pointing at. Have you tried stepping though with the debugger, checking the value against the value at creation?

Share this post


Link to post
Share on other sites
lpddsprimary=NULL;
memset(&lpddsprimary,0,sizeof(lpddsprimary));
lpdd4->CreateSurface(&ddsd, &lpddsprimary, NULL);
lpddsprimary->GetPixelFormat(&ddpixel);
This is the code that deals with this variable.


I came, I saw, I got programmers block.
~V''''lion

Share this post


Link to post
Share on other sites
Check that lpddsprimary != NULL after you''ve created the surface. If it is, check the return code from CreateSurface.

Share this post


Link to post
Share on other sites
Okay, ill try that in 9 hours or so. :-) thanx

I came, I saw, I got programmers block.
~V''''lion

Share this post


Link to post
Share on other sites
Hmm.... that doesnt work.
Heres the asm code that the exception happens at.
I have no clue what is going wrong.
79: lpddsprimary->GetPixelFormat(&ddpixel);//it should evaluate correctly seince SetDisplayMode worked right.
00401632 8B 4D FC mov ecx,dword ptr [ebp-4]
00401635 81 C1 8C 00 00 00 add ecx,8Ch
0040163B 8B F4 mov esi,esp
0040163D 51 push ecx
0040163E 8B 55 FC mov edx,dword ptr [ebp-4]
00401641 8B 42 08 mov eax,dword ptr [edx+8]
00401644 8B 4D FC mov ecx,dword ptr [ebp-4]
00401647 8B 51 08 mov edx,dword ptr [ecx+8]
; okay, this is the erroring code. 40124a
0040164A 8B 0A mov ecx,dword ptr [edx]
0040164C 50 push eax
0040164D FF 51 54 call dword ptr [ecx+54h]
00401650 3B F4 cmp esi,esp
00401652 E8 F9 03 00 00 call __chkesp (00401a50)


I came, I saw, I got programmers block.
~V''lion

Edited by - Vlion on February 15, 2001 3:25:13 PM

Share this post


Link to post
Share on other sites

  • Advertisement