Mattias Gaertner wrote:
On Mon, 24 Apr 2006 22:13:53 +0100
Ian bell <[EMAIL PROTECTED]> wrote:
I am trying to set up an event handler to be triggered by data
appearing at a serial port by using AddEventHandler in LCLIntf. One of
the paramters I need to pass is the procedure that is the event
handler to be called. This is declared in AddEventHandler as
AEventHandler: TWaitHandleEvent; and TWaitHandleEvent is declared as:
TWaitHandleEvent = procedure(AData: PtrInt; AFlags: dword) of object;
So I have my procedure
procedure MyEventHandler(AData: PtrInt; AFlags: dWord); declared and
defined. How do I pass it to AddEvent Handler. If I just pass its name
I get a too many arguments error.
@MyEventHandle
Closer. Now I get this error:
unit1.pas(200,69) Error: Incompatible type for arg no. 3: Got
"<address of procedure(LongInt, LongWord);Register>", expected
"<procedure variable type of procedure(LongInt, LongWord) of
object;Register>"
Ian
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives