I am not at all an expert at object-oriented Pascal and the LCL, but I have been running the same program for
years on 32-bit Windows with separate threads for a long calculation which occasionally needs to
communicate with the main thread i.e. mouse to cancel and logging on screen. This worked including with
the Lazarus which used FPC 2.6.4. Recently I have been trying to update my Lazarus so was trying
to use FPC 3.0.2. However the thread communication procedure Synchronize is apparently different
now. The help system says it needs 2 parameters instead of 1. When I give it my guess as to
what the 2 parameters should be, it still has an error. The following is a short code section
and the error messages.
.
.
procedure TNewtThread.DoWriteLog;
begin
_LogString;
end;
procedure TDynThread.DoWriteLog;
begin
_LogString;
end;
procedure TNewtThread.DoWrite; {This appears to be a new parameter set for Synchronize}
begin
140 Synchronize(TNewtThread,TNewtThread.DoWriteLog);
end;
procedure TDynThread.DoWrite;
begin
Synchronize(TDynThread.DoWriteLog); {This is the old form which has been used for years}
145 end;
.
.
Messages:
DUnit1.pas(140,50)Error: Only class methods, class properties, and class variables can be accessed in class methods
DUnit1.pas(140,50)Error: Only class methods, class properties, and class variables can be referred with class methods
DUnit1.pas(144,37)Error: Only class methods, class properties, and class variables can be accessed in class methods
DUnit1.pas(144,37)Error: Only class methods, class properties, and class variables can be referred with class methods
etc.
Help!