This class allows you to be notified about the events that occurred during the execution of a task performed by an instance of a object. You should adopt the new approach instead of the older (and deprecated) one based onto a passed to the instance.
If the component service in use and its property is set to true, the QTPlgComponentServiceControl class events will never be invoked. This is due to the fact that callbacks called from a background thread must be thread–safe and Real Studio events mechanism is not. In cases such as this, the background processes will send events to the main thread queue. If you want to monitor the status of the currently active background threads, you will need to implement a custom events handler in the application main thread. In practice, all you have to do is to use the class method to install your callback and, then, retrieve and propagate as appropriate to your needs the informations about the generated event brought to you by the callback. A detailed discussion about this topic is included into the documentation of the class method below. As the management of background threads if completely handled by the component service instance, even if you do not provide such a event handler, nevertheless the background mechanism will continue to work, but, of course, I will not be able to keep track of the status of the active threads.
MyBackTaskEventHandler(info as as )
The- serviceStarted("THST"): this event is analogous to the class event; use the
property of the
info parameter to identify the thread instance that has generated the event - serviceDone("THED"): this event is analogous to the class event; just like the event above,
use the property of the
info parameter to identify the finished thread - serviceProgress("THPG"): this event is analogous to the class event; use the property to identify the thread instance and the property to retrieve the percentage of accomplished task
- serviceError("THER"): this event is analogous to the class event;
use the property of the
info parameter to find about the code of the error occurred during the processing of data accomplished by the thread identified by
The QTPlgComponentServiceControl class constructors are called when you create a new instance of the class, while
the ˜QTPlgComponentServiceControl class destructor, is called automatically when the
class is no more in use. Also, you can invoke the class destructor by setting the instance of the class to nil.
The class provides you with the following initializer methods: