In my app I need to pause the current process and display a message on an external (thru COM port) device. Since data is coming in from other ports on the computer that I monitor, I use a form class with a timer.
Form Props:
Top = 468
Left = 4
Height = 22
Width = 104
ShowWindow = 1
DoCreate = .T.
Caption = "Form1"
Visible = .T.
WindowType = 1
Name = "delayform"
Methods:
PROCEDURE Init
PARAMETERS nInterval
ThisForm.Timer1.Interval = nInterval
ThisForm.Timer1.Enabled = .T.
ENDPROC
PROCEDURE Unload
ret_value = .T.
RETURN ret_value
ENDPROC
The timer1 has this code in it's timer event:
PROCEDURE Timer
This.Enabled = .F.
Thisform.Release
ENDPROC
So I call it as so
obb = CREATEOBJECT("delayform",5000)
obb.show
So the form starts up and enables the timer which fires after 5 seconds. The Timer1.Timer event disables the timer and closes the form.THus I get my 5 second delay. (INKEY is out as it allows keystrokes to terminate it. )
This works fine for my needs. But of late I have noticed that I get an error at the CREATEOBJECT line
"Not Enough Memory to complete this operation" running in NT as well as 95/98.
I have checked in the locals window and the form object is released when the form closes. What is causing this memory error. Am I doing something wrong in the calling and releasing of the form? Is there a leak in memory?
Please help
Bernard