beautypg.com

Misc faq – B&B Electronics I-7060 - Quick Start Guide User Manual

Page 54

background image

Getting Started

for I-7000 Series Modules

Date: Jan-08, 2002 Version 1.02 page: 54

6.2 MISC

FAQ

Q:

Why doesn't the ComboBox's CHANGE event work with VB?

A:

In Delphi and Borland C++ Builder, the "CHANGE" event works

correctly when users choose the item from "ComboBox". But, Visual Basic,
this event only occurs when users code in the “CLICK” event to do the same
work. This “CLICK” event also works correctly in Delphi and Borland C++
Builder.

Q: How do you prevent TIMER events from reoccurring?

A:

If the “TIMER” object is used, please ensure the set Interval values of

the “TIMER” object are appropriate for your program, system and hardware.

Suppose the “TIMER” object triggers an event to do something, and

then re-triggers the event to do the same work before the prior job has ended.
This may cause two jobs run concurrently. Over time, this might crash the
user’s system. If many jobs are running at the same time; the system could
overload.

To prevent a system crash with the “TIMER” object, note the following

"TIMER" event situation. Please do not give the TIMER object simultaneous
jobs, per the example below.

bool bProcessing ;

// declare a flag

void __fastcall TForm1::

FormCreate

(TObject *Sender)

{

bProcessing = false;

}

void __fastcall TForm1::

Timer1Timer

(TObject *Sender)

{

if (bProcessing == true)

return ;

// avoid reenter

else