Why does my program crash when I lock a surface
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?
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
Also, make sure that it''s the locking of your surface that is causing the crash, and not something else.
Martin
Martin
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement