DDRAWSURFACE::Lock()

Started by
5 comments, last by Cloxs 23 years, 9 months ago
I upgraded my program from DirectX1 to DirectX7, and for some reasone I can''t lock surfaces anymore, whenever I lock/unlock the program crashes.....does anyone know why? Help, please!
Advertisement
If you post the code you use for locking a surface
then maybe i can help you.
By the way, i think you have to use the LPDIRECTDRAWSURFACE7
interface for it to work properly.
Post the code your using so we can see what''s wrong. We cannot conduct an effective diagnosis.

------------------------------
#pragma twice
Ummm, okay - I am using LPDIRECTDRAWSURFACE7, and it doesn''t matter where I use lock, it never works - here''s the code.

if(FAILED(Primary->Lock(NULL, &ddsd, DDLOCK_WAIT / DDLOCK_SURFACEMEMORYPTR, NULL)))
MessageBox(NULL, "ERROR", "error", MB_OK);

if (FAILED(Primary->Unlock(NULL)))
MessageBox(NULL, "ERROR", "error", MB_OK);

"When people tell you they want to hear the truth, you know that their lying."
You may want to check your code. It should be DDLOCK_WAIT / DDLOCK_MEMORYSURFACEPTR instead of DDLOCK_WAIT / DDLOCK_MEMORYSURFACEPTR.

-----------------------------

A wise man once said "A person with half a clue is more dangerous than a person with or without one."
-----------------------------A wise man once said "A person with half a clue is more dangerous than a person with or without one."The Micro$haft BSOD T-Shirt
What version of DDSURFACEDESC are you using? Are you using DDSURFACEDESC or DDSURFACEDESC2? You should be using DDSURFACEDESC2 if your using the first one. Remember to set the dwSize member etc.

The error where the pipe character (¦ with the two halves joined up which means the logical or) is an error in the forum software, not in Cloxs' code. It gets turned into a / .

And it is DDLOCK_SURFACEMEMORYPTR and not DDLOCK_MEMORYSURFACEPTR as ImmaGNUman may have suggested.

Edited by - furby100 on June 25, 2000 11:55:20 AM

This topic is closed to new replies.

Advertisement