Visual C++ Bitmaps

I've created a Bitmap using the resource editor and I'm wanting to use that bitmap as the title of my display which was drawn using DirectDraw.  The application has not been written using the App Wizard.  However, when I try and use the LoadBitmap using
LoadBitmap(hInstance, "TITLE") function to load my bitmap, it displays nothing on the screen! Thats all I've done.  But why does it not do anything.  All I want to do is display it... surely it shouldn't be that too difficult.
I don't know what else to do.. Please help!!

Regards
John
MonkeyDoylesAsked:
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.

BudVVeezerCommented:
First off, if you are going to draw the bitmap using DirectDraw, then it's a different approach, so I can tell you that one too.  But here's how you load and draw a bitmap to a window in C.

HBITMAP hBit = LoadBitmap(hInstance, MAKEINTRESOURCE(IDD_BITMAP1));
HDC hDc = CreateCompatibleDC(GetDC(hWnd));
SelectObject(hDc, hBit);

BitBlt(GetDC(hWnd), 0, 0, x, y, hDc, 0, 0, SRCCOPY);

In the load bitmap, the first parameter is the HINSTANCE of the app, the second is a LPSTR of the resource.  In VC, it assigns IDD_BITMAP1, but you can rename it to whatever you want.  In CreatComp..you give it the DC of the window, which you get with GetDC.  THen you select the bitmap into the DC.  BitBlt is the part where it actually draws the bitmap to the screen.  If you have any questions, just ask!

~Aaron
0

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
MonkeyDoylesAuthor Commented:
Thank you and ..... thank you!
0
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
Hardware

From novice to tech pro — start learning today.