Why does my program crash when I lock a surface

Started by
3 comments, last by C++ Freak 24 years ago
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?
Visit http://members.xoom.com/ivanickgames
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
______________Martin EstevaolpSoftware
Also, make sure that it''s the locking of your surface that is causing the crash, and not something else.

Martin
______________Martin EstevaolpSoftware
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
Thanks for the help. It turns out the problem was with the surface.

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

This topic is closed to new replies.

Advertisement