Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with IdHTTPServer in Lazarus
#4
(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;

Reply


Messages In This Thread
RE: Problem with IdHTTPServer in Lazarus - by rlebeau - 10-07-2021, 02:01 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)