[fpc-pascal] How to get a data module to notify of events?
vfclists at gmail.com
Thu Sep 15 16:28:29 CEST 2011
I have a form with some threaded objects that notify another form of events
by calling one of that forms events.
I want to convert to a data module and any interested object to register for
My idea is for each thread to have some kind of list of procedure types and
each interested object registers its routine eg.
This is the data module. It is a rough sketch and may have some syntax
Type TOneArg = Procedure (Var X : integer);
> TMonitorObject = class(TThread)
> InterestedObjects: TList
> procedure DispatchOutput;
> procedure DisplayRawOutput;
> procedure Execute; override;
> constructor Create(CreateSuspended: Boolean);
> procedure TMonitorObject.DispatchOutput;
> foreach InterestedObject do
> constructor TMonitorObject.Create(CreateSuspended: Boolean);
> inherited Create(CreateSuspended);
> InterestedObjects := TList.Create
> FCycleComplete := True;
Do the procedures for the objects which require notification need to be
constructed in some way?
Am I on the right track here? I am particularly interested in what happens
when the objects passing the routines are destroyed without the data module
knowing about it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal