Florian - 2012-02-16

this is probably due to the memory consumption..

try changing the DeleteObject order in RectangleSend( LPVOID parent ):

DeleteObject(hBMP);
DeleteObject(hBMPCmpCopy);
DeleteDC(hDCCopy);
DeleteDC(hDCCmpCopy);
//DC must be deleted before DIB otherwise DIB remains in memory
DeleteObject(hDIBCmp);
DeleteObject(hDIB);