Howdy!
I have a program that changes a series of images, all via DDT, in a dialog based on each record. After changing records a few times, the images quit updating.
So, to reproduce the problem, I wrote a little 48 line tester, which for each button click, changes an image. It, too, fails, in this case after about 750 reps.
Has anyone else had such a problem?
If anyone is interested, the test program follows. It refers to a resource file, which contains two small BMP's.
All this program does is present a simple dialog. Each time Increment is clicked, a number counts (so I can see how long it takes to fail) and the image toggles between two images. Holding down the Enter key, the number counts quickly and the image flickers between the two BMP's. After about 700 counts, the image just flatly quits changing.
Have I reached some limitation in Win-doze? Perhaps I am doing something wrong.
Any suggestions or ideas would be GREATLY appreciated!!!
Thanks
Dan
{Filename: toggle.rc}
31 BITMAP CIRCLE.bmp
32 BITMAP OPENCIR.bmp
{filename: toggle.bas}
%d001count = 10000
%d001incr = 10001
%d001image = 10002
%d001cancel = 10003
#COMPILE EXE
#RESOURCE "toggle.pbr"
#INCLUDE "win32api.inc"
#INCLUDE "commctrl.inc"
GLOBAL handled001 AS LONG
DECLARE CALLBACK FUNCTION callbackd001
FUNCTION winmain (BYVAL hinstance AS LONG, BYVAL hprevinstance AS LONG, lpcmdline AS ASCIIZ PTR, BYVAL icmdshow AS LONG) AS LONG
DIALOG NEW 0, "Toggle Screen", , , 100, 75, %WS_CAPTION + %WS_SYSMENU + %WS_THICKFRAME + %WS_MINIMIZEBOX, to handled001
CONTROL ADD LABEL, handled001, %d001count, "1", 10, 10, 40, 14
CONTROL ADD BUTTON, handled001, %d001incr, "Increment", 10, 30, 40, 14
CONTROL ADD BUTTON, handled001, %d001cancel, "Cancel", 10, 50, 40, 14
CONTROL ADD IMAGE, handled001, %d001image, "#32", 60, 10, 20, 20, %SS_REALSIZE + %SS_CENTERIMAGE
DIALOG SHOW MODAL handled001, CALL callbackd001
END FUNCTION
CALLBACK FUNCTION callbackd001
STATIC s AS STRING
SELECT CASE CBMSG
CASE %WM_COMMAND
SELECT CASE CBWPARAM
CASE %d001cancel
DIALOG END handled001
CASE %d001incr
CONTROL GET TEXT handled001, %d001count TO s
IF VAL(s) / 2 = VAL(s) \ 2 THEN
CONTROL SET IMAGE handled001, %d001image, "#31"
ELSE
CONTROL SET IMAGE handled001, %d001image, "#32"
END IF
CONTROL SET TEXT handled001, %d001count, LTRIM$(STR$(VAL(s) + 1))
DIALOG DOEVENTS
END SELECT
END SELECT
END FUNCTION
I have a program that changes a series of images, all via DDT, in a dialog based on each record. After changing records a few times, the images quit updating.
So, to reproduce the problem, I wrote a little 48 line tester, which for each button click, changes an image. It, too, fails, in this case after about 750 reps.
Has anyone else had such a problem?
If anyone is interested, the test program follows. It refers to a resource file, which contains two small BMP's.
All this program does is present a simple dialog. Each time Increment is clicked, a number counts (so I can see how long it takes to fail) and the image toggles between two images. Holding down the Enter key, the number counts quickly and the image flickers between the two BMP's. After about 700 counts, the image just flatly quits changing.
Have I reached some limitation in Win-doze? Perhaps I am doing something wrong.
Any suggestions or ideas would be GREATLY appreciated!!!
Thanks
Dan
{Filename: toggle.rc}
31 BITMAP CIRCLE.bmp
32 BITMAP OPENCIR.bmp
{filename: toggle.bas}
%d001count = 10000
%d001incr = 10001
%d001image = 10002
%d001cancel = 10003
#COMPILE EXE
#RESOURCE "toggle.pbr"
#INCLUDE "win32api.inc"
#INCLUDE "commctrl.inc"
GLOBAL handled001 AS LONG
DECLARE CALLBACK FUNCTION callbackd001
FUNCTION winmain (BYVAL hinstance AS LONG, BYVAL hprevinstance AS LONG, lpcmdline AS ASCIIZ PTR, BYVAL icmdshow AS LONG) AS LONG
DIALOG NEW 0, "Toggle Screen", , , 100, 75, %WS_CAPTION + %WS_SYSMENU + %WS_THICKFRAME + %WS_MINIMIZEBOX, to handled001
CONTROL ADD LABEL, handled001, %d001count, "1", 10, 10, 40, 14
CONTROL ADD BUTTON, handled001, %d001incr, "Increment", 10, 30, 40, 14
CONTROL ADD BUTTON, handled001, %d001cancel, "Cancel", 10, 50, 40, 14
CONTROL ADD IMAGE, handled001, %d001image, "#32", 60, 10, 20, 20, %SS_REALSIZE + %SS_CENTERIMAGE
DIALOG SHOW MODAL handled001, CALL callbackd001
END FUNCTION
CALLBACK FUNCTION callbackd001
STATIC s AS STRING
SELECT CASE CBMSG
CASE %WM_COMMAND
SELECT CASE CBWPARAM
CASE %d001cancel
DIALOG END handled001
CASE %d001incr
CONTROL GET TEXT handled001, %d001count TO s
IF VAL(s) / 2 = VAL(s) \ 2 THEN
CONTROL SET IMAGE handled001, %d001image, "#31"
ELSE
CONTROL SET IMAGE handled001, %d001image, "#32"
END IF
CONTROL SET TEXT handled001, %d001count, LTRIM$(STR$(VAL(s) + 1))
DIALOG DOEVENTS
END SELECT
END SELECT
END FUNCTION
Comment