This code:
HBITMAP patternBMP =NULL;
patternBMP = (HBITMAP)LoadImge(hInstance, "bitmap.bmp", IMAGE_BITMAP,0,0,LR_LOADFROFILE);
doesn't work because you are not following th rthe TCHAR mappings.
There is no function named LoadImage. There is only LoadImageA that uses a LPCSTR argument and LoadImageW that uses an LPCWTSR. LoadImage itself is a macro. It resolves to LoadImageA if you build with ASCII and resolves to LoadImageW when you build with Unicode.
You need to a) set your character set.
b) call LoadImage using a TCHAR mapping
Your code should be:
-
HBITMAP patternBMP =NULL;
-
-
patternBMP = (HBITMAP)LoadImge(hInstance, TEXT("bitmap.bmp"), IMAGE_BITMAP,0,0,LR_LOADFROFILE);
-
The character set used is in your Project Properties->Congifuration Properties->General->character set in the rigtht pane.
You do not use:
#ifdef UNICODE
#undef UNICODE
....
my code goes here
.....
#endif
You should be using a _tmain() rather than a main().