martedì 2 novembre 2010

MegaED X: Some problems with WinNT 4 and Win9x

I think that an important thing is that a software must be compatible with (almost) all O.S. and must be optimized for speed. The first release is compatible with Windows XP or more but I'm working on compatibility with Windows 95/98/ME, Windows NT4/2K and a x64 version.
With the oldest OSs the editor suffer of some problems or memory leaks:
  • Windows 95 miss msimg32.dll, it can be taken from Win98 and it contains TransparentBlt for the transparence on texts. Only Palette and Tileset works.
  • Windows 98, memory leak when I use SelectObject(tempDC, objecToUse). Only Palette and Tileset works.
  • Windows NT 4.0, miss msimg32.dll (if I take it from Win98 there are memory leaks from TransparentBlt), take A LOT of RAM (about 100MB) but the editor works and it's fast as NT 5.1/6.x
This is the part that draw the internal window of Palette Editor:
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);
HDC hBack = CreateCompatibleDC(hdc);
HBITMAP hBmpBack = CreateCompatibleBitmap(hdc, ps.rcPaint.right, ps.rcPaint.bottom);
SelectObject(hBack, hBmpBack); // <== Memory leak on Win9x

// Some stuff


BitBlt(hdc, 0, 0, ps.rcPaint.right, ps.rcPaint.bottom, hBack, 0, 0, SRCCOPY);
DeleteObject(hBmpBack);
DeleteDC(hBack);
EndPaint(hWnd, &ps);
}
break;


If someone know how to fix it please reply.

Nessun commento:

Posta un commento