• Advertisement

Archived

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

Why does my program crash when I lock a surface

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

Here is the problem code (Surface)->Lock(NULL,&ddsd,DDLOCK_WAIT / DDLOCK_SURFACEMEMORYPTR,NULL); How can I fix it so that my program doesn''t crash when I lock a surface?

Share this post


Link to post
Share on other sites
Advertisement
That code looks OK to me (without really checking), but maybe your surface description (ddsd) is initialized screwy, did you forget to memset() ddsd and set ddsd.dwSize. If you did, I don''t know what could be wrong.

Martin

Share this post


Link to post
Share on other sites
Also, make sure that it''s the locking of your surface that is causing the crash, and not something else.

Martin

Share this post


Link to post
Share on other sites
are you trying to debug your code while locking a surface?
DO NOT try to debug this, it will result in an immediate crash if you set a breakpoint into code that has a surface locked

Share this post


Link to post
Share on other sites
Thanks for the help. It turns out the problem was with the surface.

Visit http://members.xoom.com/ivanickgames

Share this post


Link to post
Share on other sites

  • Advertisement