(10-06-2021, 11:57 PM)BartKindt Wrote: I use the same code as in my Delphi Appllications, but this does not work in Lazarus:
...
I get a 'Wrong number of parameters...' on all these lines.
Those lines are just declarations, so you can't get such an error on them. You must be getting errors when trying to use the TDebugLogEventHandlers class elsewhere in your code. In particular, which {$mode} are you compiling in? I am assuming it is NOT {$mode delphi}. If so, then you need to use the @ address operator when assigning the event handlers. See Lazarus - why I can't assign event to run-time component?
For example:
Code:
type
TDebugLogEventHandlers = class
public
class procedure IdHTTPServer1CommandGet(AContext: TIdContext;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
class procedure IdHTTPServer1Exception(AContext: TIdContext; AException: Exception);
end;
...
IdHTTPServer1.OnCommandGet := @TDebugLogEventHandlers.IdHTTPServer1CommandGet;
IdHTTPServer1.OnException := @TDebugLogEventHandlers.IdHTTPServer1Exception;