Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timer stops generating events when main program is called

Status
Not open for further replies.

cindy13732

Technical User
Jun 9, 2011
9
US
Borland 6
I want the test executing statement to flash while the test is running. The timer works until the EFCSER_MAIN code is called.
Timer1Timer is not called again until it returns from EFCSER_MAIN.

Tag initialized to 0, Interval to 1000, and Enabled to true

void __fastcall TForm1::ExecuteButtonClick(TObject *Sender)
{
.
.
.
executeFlag = true;
.
.
.
EFCSER_MAIN();

executeFlag = false;
Form1->Caption = "Test Complete ";
.
.
.
}

void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
if (executeFlag == true)
{
if (Timer1->Tag == 0)
{
Form1->Caption = "Test Executing... ";
Timer1->Tag = 1;
}
else
{
Form1->Caption = "";
Timer1->Tag = 0;
}
}


Any thoughts?
 
Timer1Timer is not called again until it returns from EFCSER_MAIN.
That's correct. If you want the timer to run independently of the program, you will need to create a thread to call it.



James P. Cottingham
[sup]I'm number 1,229!
I'm number 1,229![/sup]
 
Are you telling me that this Timer isn't supposed to run all the time and interrupt the code like a Watchdog timer?

Why does it run and interrupt the startup code (ie buttonclick functions), and not the rest of the processing?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top