I am transferring some of my code (half written games, etc) from an old
(Win98) PC to a laptop running Vista.
The following function no longer works.
void DisplayBitmap (char* filename, UINT width, UINT height)
{
HANDLE hBitmap = ::LoadImage (g_hInstance, filename,
IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
PAINTSTRUCT ps;
HDC hDC = ::BeginPaint (hWnd, &ps);
HDC memDC = ::CreateCompatibleDC (hDC);
HGDIOBJ hObj = ::SelectObject (memDC, hBitmap);
BOOL bRes = ::BitBlt (hDC, 0, 0, width, height,
memDC, 0, 0, SRCCOPY);
::DeleteDC (memDC);
::EndPaint (hWnd, &ps);
::DeleteObject (hBitmap);
::InvalidateRect (hWnd, &rect, true);
}
Everything returns TRUE or valid handles, but I get a white screen.
Any ideas?
** Posted from http://www.teranews.com **