Simple Window Programming Questions

I am developing a Game in GDI for Windows and uses WinAPI.

When I'm running the Game in WinXP everything is OK, but when I'm trying to run it under Win98 or WinME the Game Looses the Graphics and Font Settings that I have written...

I Think that it gottohave with the HDC stuff to do...

Uses the following to print the Graphics:

void GamePaint(HDC hdc)
     // Draw The Game Plan...
     GamePlan->Draw(hdc, 0, 0);


void GameCycle()
        HDC hDC = GetDC(Game->GetWindow());


     BitBlt(hDC, 0, 0, Game->GetWidth(), Game->GetHeight(),
          _hOffscreenDC, 0,0, SRCCOPY);
     DeleteDC(hDC); // Unsure if I sould delete it or not???

And a Second question:
Does someone have some info about desgining own Windows or some tutorial??
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I don;t think windows 98 fully support GDI/GDI+ out of the box very well. Make sure you've downloaded the latest patches from Microsoft Update. Windows XP/Me/2000 would have newer versions that Win98. Maybe that's the issue.
I think your mistake it's DeleteDC. Try to use ReleaseDC instead. Sorry for my English...
GDI is fully supported out of the win 98 box.  GDI+ is not.  However this is not the problem....  It could be a problem with DeleteDC

from MSDN

"An application must not delete a device context whose handle was obtained by calling the GetDC function. Instead, it must call the ReleaseDC function to free the device context."

call ReleaseDC instead.
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

SnurreAuthor Commented:
Yes I Saw it on the MSN that it should be ReleaseDC instead, but, It's Still Messed up.

I'm going to explain a little more...

I have created all the nessesary stuff needed for my game, Bitmap Handlers and Sprites and more... And they are proofed to function under Win98 and Later...

But when I Started doing this Game I got the troubles with the Graphics disapering.

All I would need to know is, when should I Release the HDC Handler, It's used in many different Functions, Should I only have ONE Global HDC, does it make any difference in Passing the DC on in the Function header, or if I use the GetDC() Function??

My English isen't good Eighter... Sorry for the Inconvinience :o)
Games relying on GDI are not expected anyway to be especially performant.
Normally a global Device Context used with almost no pause on the same window should not cause problems and could be released at the very end of using the window.

A good tutorial on Windows programming is written by Brook Miles, who likes to appear on the name The Forger.
Another good source for small Games in Window is the site

Gool luck !

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SnurreAuthor Commented:
I Give you the Points for the Funni little Gaming Site and The Tut you Recomended...

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.