Original Post
I am working with one of the SDK examples (which comes with the MSDN Library), but I have a problem as it is not compatible with VC++ 6.0.
There''s this code:
------------------------
1. HDC hdc;
2. HDC hmemorydcNew;
3. HDC hmemorydcOld;
4. LONG checkMarkSize;
5. HBITMAP hCheckBitmap;
6. HBITMAP hOldBitmapSave;
7. HBITMAP hNewBitmapSave;
8.
9. hdc = GetDC (hwnd);
10.
11. hmemorydcNew = CreateCompatibleDC (hdc);
12. hmemorydcOld = CreateCompatibleDC (hdc);
13.
14. checkMarkSize = GetMenuCheckMarkDimensions ();
15.
16. hCheckBitmap = CreateCompatibleBitmap (hdc, LOWORD (checkMarkSize),HIWORD (checkMarkSize));
17.
18. hOldBitmapSave = SelectObject (hmemorydcNew, hCheckBitmap);
19. hNewBitmapSave = SelectObject (hmemorydcOld, hbm);
-------------------------
Lines 18 and 19 throw an error like this:
Error C2440: ''='' : cannot convert from ''void *'' to ''struct HBITMAP__ *''
Conversion from ''void*'' to pointer to non-''void'' requires an explicit cast
Someone said that it was written with VC++ 5.0. So, how should I fix it to make it VC++ 6.0 compatible ?????

