Skip to main content
gamedev.net
🔒 Locked

Blt...

Started by Ersvik Aug 9, 2002 at 6:33 AM 1 replies 250+ views
Original Post
Ersvik
Ersvik
Hi, this code is resulting in an access violation after running a few seconds: HRESULT DrawRect(RECT *lpRect, USHORT Col) { DDBLTFX ddbltfx; ddbltfx.dwSize = sizeof(ddbltfx); ddbltfx.dwFillColor = Col; return lpBackBuffer->Blt(lpRect, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &ddbltfx); } Any idea why? Johan Johan Ersvik
Johan
EbonySeraph
EbonySeraph
All I can think of is zeroing the memory for the struct... add the line

ZeroMemory(&ddbltfx, sizeof(DDBLTFX));

before setting the sizeof data member.


"Ogun''s Laughter Is No Joke!!!" - Ogun Kills On The Right, A Nigerian Poem.
"Ogun's Laughter Is No Joke!!!" - Ogun Kills On The Right, A Nigerian Poem.
GarlandIX
GarlandIX
Also, make sure the surface you are trying to Blt to isn''t locked.

------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.
------------------------------BASIC programmers don't die, they just GOSUB and don't return.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.