I am making a little bord game and I use GDI to draw the bord.
I draw the bord in a static text control. The program compile withaout
any error or warning and it's working fine. I have a button that rolls the
dices and the pawn on the bord are moving to the place they belong too and
it's working ok !!!
After I roll the dices approximately 100 times somes of the pawn are
invisible ???
If I switch to another application and comme back to the game(to get a call
of WM_PAINT) the bord doesn't draw itself anymore and I get those message in
the debug box !
Warning: Uncaught exception in WindowProc (returning 0).
First-chance exception in StockGame.exe (MSVCRTD.DLL): 0xE06D7363: Microsoft
C++ Exception.
First-chance exception in StockGame.exe (MSVCRTD.DLL): 0xE06D7363: Microsoft
C++ Exception.
Warning: Uncaught exception in WindowProc (returning 0).
Warning: Uncaught exception in WindowProc (returning 0).
First-chance exception in StockGame.exe (MSVCRTD.DLL): 0xE06D7363: Microsoft
C++ Exception.
The thread 0xFFF9ED49 has exited with code 0 (0x0).
what is strange it's that it always occur after 100 click of the roll button
???
If you can help me please e-mail me the anwser to bugf...@videotron.ca
or reply to this message in the group !!!
Frédéric Fortin wrote in message ...
In my OnPaint function I was using a CBrush pointer that I was initializing
to a brush and I was deleting it with "delete aBrush ;" and I was recreating
a different one with the same pointer. I suppose that memory was missing
after a while.... Instead I used 2 Brush variable and everything is working
fine but now I'm wondering what is the proper way to safely delete a Brush
????
Frédéric Fortin <f_fo...@videotron.ca> wrote in message
news:cDbG3.2559$nX6....@wagner.videotron.net...