Bitmap Program Help

This is a discussion on Bitmap Program Help within the Windows Programming forums, part of the Platform Specific Boards category; Hello again,
Trying to get back into windows programming after a brief 2 year hiatus; here is a bit o' ...

Bitmap Program Help

Hello again,

Trying to get back into windows programming after a brief 2 year hiatus; here is a bit o' code that is simply supposed to load a bitmap and display it on a window. My bitmap coding logic is based on this tutorial: http://www.winprog.org/tutorial/bitmaps.html

I have commented out a lot of code (colored green) that was generating errors, but I am currently stuck with the following error(s):

Code:

C:\Users\Dsve\Desktop\blackjack\main.cpp|125|error: variable or field `command' declared void
and more....

C:\Users\Dsve\Desktop\blackjack\main.cpp|136|error: `MAKEINTORESOURCE' was not declared in this scope|

Seems like this part of the code does not have access to the windows.h library for the makeintoresource macro... any suggestions?

Also, I would like to point out that in this line:

Code:

HBITMAP hbmCard = (HBITMAP)(SelectObject(hdcMem, hCard));

I had to cast the return value from SelectObject( ) to an HBITMAP.. the compiler originally gave me an, 'illegal conversion from void* to HBITMAP. Just wondering if this is acceptable since it wasn't in the tutorial.

WM_PAINT is not a subset of WM_COMMAND msgs. (you are switch'ing twice on the same UINT and expecting differing values)

So the drawing code will not get called.

Originally Posted by The Brain

Also, I would like to point out that in this line:

Code:

HBITMAP hbmCard = (HBITMAP)(SelectObject(hdcMem, hCard));

I had to cast the return value from SelectObject( ) to an HBITMAP.. the compiler originally gave me an, 'illegal conversion from void* to HBITMAP. Just wondering if this is acceptable since it wasn't in the tutorial.

Is 'C" style cast and is required if using .c files (but not for .ccp)