Hi there,
just spend a whole day on debuging. Made a programm which blocks a
whole NT Server after running some days. Found out that
repeatedly calling CONTROL SET IMAGE makes the trouble.
I'll use CONTROL SEND CBHNDL, 100, %STM_SETIMAGE, %IMAGE_BITMAP, hBmp
instead. Are there any known side effects ? Pls look at the source below.
Ralph
------------------
just spend a whole day on debuging. Made a programm which blocks a
whole NT Server after running some days. Found out that
repeatedly calling CONTROL SET IMAGE makes the trouble.
I'll use CONTROL SEND CBHNDL, 100, %STM_SETIMAGE, %IMAGE_BITMAP, hBmp
instead. Are there any known side effects ? Pls look at the source below.
Ralph
Code:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' file : ddtsplash.bas ' #DIM ALL #COMPILE EXE #INCLUDE "win32api.inc" #RESOURCE "dsplash.pbr" CALLBACK FUNCTION CB_animate STATIC picture AS LONG STATIC sTimer AS LONG SELECT CASE CBMSG CASE %WM_INITDIALOG DIM arrBmp(1000 TO 1006) AS STATIC LONG FOR picture = 1000 TO 1006 arrBmp(picture) = LoadBitmap( GetModuleHandle (BYVAL 0&), "#"+STR$(picture) ) NEXT sTimer = SetTimer(CBHNDL, 0, 120, %NULL) picture = 1000 CASE %WM_DESTROY CONTROL SEND CBHNDL, sTimer, %WM_DESTROY, CBWPARAM, CBLPARAM FOR picture = 1000 TO 1006 DeleteObject arrBmp(picture) NEXT CASE %WM_TIMER INCR picture IF picture = 1007 THEN picture = 1000 '''''' main thing '''''' use CONTROL SEND CBHNDL, 100, %STM_SETIMAGE, %IMAGE_BITMAP, arrBmp(picture) '''''' instead of ' CONTROL SET IMAGE, CBHNDL, 100, "#" + STR$(picture) CASE %WM_LBUTTONDOWN DIALOG END CBHNDL, 1 END SELECT END FUNCTION FUNCTION PBMAIN LOCAL hdlg AS LONG DIALOG NEW 0, "animate",,, 305,158, %WS_CAPTION OR %WS_SYSMENU OR %WS_THICKFRAME TO hdlg CONTROL ADD IMAGE, hdlg, 100, "#1000", 1,1,42, 29, %WS_CHILD OR %WS_VISIBLE OR %SS_SUNKEN DIALOG SHOW MODAL hdlg CALL CB_animate END FUNCTION
------------------
Comment