• Advertisement

Archived

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

DDRAWSURFACE::Lock()

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

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!

Share this post


Link to post
Share on other sites
Advertisement
If you post the code you use for locking a surface
then maybe i can help you.

Share this post


Link to post
Share on other sites
By the way, i think you have to use the LPDIRECTDRAWSURFACE7
interface for it to work properly.

Share this post


Link to post
Share on other sites
Post the code your using so we can see what''s wrong. We cannot conduct an effective diagnosis.

------------------------------
#pragma twice

Share this post


Link to post
Share on other sites
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."

Share this post


Link to post
Share on other sites
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."

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement