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


Problems after my game exits

Recommended Posts

SikCiv    122
Im using WinME and my game use to exit ok without a hitch, but ive changed many things, and added many ''hdc'' functions, now when my game closes, the arrow turns into a black square with a bit of stray pixels in it, and my games'' taskbar button doesnt disappear after exiting unless u click on it.. Im not sure what the problem is, so is there a way to check hdc problems without spending hundreds of dollars on a program like bounds checker? Surely there is a cheap alternative? I dont use MSDev, just the command line commands (nmake). here is my code... ---------------------------- HDC dc; lpDDSBack->GetDC(&dc); if(!dc) return; SetBKColor(dc, RGB(0,0,0)); SelectObject(dc, GetStockObject(WHITE_PEN)); SelectObject(dc, GetStockObject(BLACK_BRUSH)); rectangle(dc, rcDest.left, rcDest.....etc.. lpDDSBack->ReleaseDC(dc); --------------------------- In WinME do u have to close the app differently to Win95/98?

Share this post

Link to post
Share on other sites
Jim Adams    440
In case you''re not doing it - make sure to restore the hdc to how it was when you''re done with it:

// setting new brush
HBRUSH *OldBrush = SelectObject(hDC, GetStockObject(BLACK_BRUSH));

// restoring old brush
SelectObject(hDC, OldBrush);

Jim Adams

Share this post

Link to post
Share on other sites