--- mstools/samples/showdib/drawdib.c 2018/08/09 18:20:01 1.1 +++ mstools/samples/showdib/drawdib.c 2018/08/09 18:21:42 1.1.1.3 @@ -470,7 +470,7 @@ VOID BandDIB ( lpbi->biHeight = wRead ; /* Set the DIB bits to a device-dependent format */ - if (lpbi->biHeight != (DWORD)SetDIBits (hMemDC, + if (lpbi->biHeight != (int)SetDIBits (hMemDC, hBitmap, 0, (WORD)lpbi->biHeight, @@ -555,9 +555,11 @@ VOID SizeWindow (HWND hWnd) /* Extract the filename from the full pathname */ pstr = achFileName + lstrlen(achFileName) - 1; - while ((*pstr != '\\') && (*pstr != ':') && (pstr >= achFileName)) + while ((*pstr != '\\') && (*pstr != ':') && (pstr > achFileName)) pstr--; - pstr++; + + if(pstr != achFileName) + pstr++; /* Format filename along with the DIB attributes */ sprintf (Name, @@ -965,7 +967,7 @@ BOOL fDialog ( hInst = (HANDLE)GetWindowLong (hwnd, GWL_HINSTANCE); fpfn = MakeProcInstance (fpfn, hInst); - f = DialogBox (hInst, MAKEINTRESOURCE(id), hwnd, (WNDPROC)fpfn); + f = DialogBox (hInst, MAKEINTRESOURCE(id), hwnd, (DLGPROC)fpfn); FreeProcInstance (fpfn); return f; }