The program that I am having problems with runs fairly well in windows
98 2nd ed.
I tried it on a machine with windows XP and my problems started.
The background screen is blue. I then want to put a small yellow
rectangle on the screen and then load black and white bitmaps
into the yellow rectangle.
The Yellow Rectangle Doesn't Apprear at all.
Would someone be so kind as to point me where to start looking
for the problem?

Many Thanks,
JPS
Posted on 2002-08-04 08:52:12 by shankle
Start looking in the routine which displays the rectangle :grin:

You have to check the return value of functions where you assume they suceed. You may have been doing something which due to a quirk in Win98se it woriked, but that quirk may not be present in XP. Or XP may be bugged, but if you're drawing those rectangle with regular gdi calls then thats unlikly.

Post some of the offending code here.
Posted on 2002-08-04 12:17:27 by Eóin
This is in reply to Eoin's request for problem code samples.
Posted on 2002-08-04 15:30:00 by shankle
Adding CS_OWNDC to the window class stlye solves most problems associated with GetDC. If it's not there you can never know for how long the Dc returned will remain valid.

In the DoAllSeven Proc the bitmaps most likly stopped displaying because the added GetDC scrambled edx which you later use in the BitBlt. This is always something to look out for :)

"It seems there are an awful lot of calls to GETDC or does that make any difference." It onlys makes a difference if you don't have the CS_OWNDC style. When you do put in the style you'll only ever need one call to GetDc at the start, then save that in a global variable and and use it everywhere. Then only one call to ReleaseDC at the end.
Posted on 2002-08-04 16:57:52 by Eóin