I am trying to use AsyncCalls which suppose to work for Delphi 5 also.
Everything compiles and runs fine, if I comment the lines that call/use ApplicationHandleException classes variable which Delphi 5 does not have (I'm not sure when it was introduced either).
procedure TThreadPool.MainThreadWndProc(var Msg: TMessage); begin try ... except if Assigned(ApplicationHandleException) then ApplicationHandleException(Self); end; end;
I'm almost sure that in Delphi 5 the above should be:
try
...
except
Application.HandleException(Self);
end;
But not sure what to do about this code:
destructor TInternalAsyncCall.Destroy; begin ... // TAsyncCall.Destroy either already called Sync() or we are a "forgotten" async call // and we need to handle the exception ourself by trying to throw it in the main thread // or just ignoring it. if FFatalException <> nil then begin if Assigned(ApplicationHandleException) and // <--- (ThreadPool.FMainThreadVclHandle <> 0) and IsWindow(ThreadPool.FMainThreadVclHandle) then PostMessage(ThreadPool.FMainThreadVclHandle, WM_RAISEEXCEPTION, WPARAM(FFatalErrorAddr), LPARAM(FFatalException)) else FFatalException.Free; end; inherited Destroy; end;
What could be the correct "translation" in Delphi 5? Should I simply ignore this variable since it does not exists? please advice.
ApplicationHandleExceptioncallback was introduced in Delphi 6, as part of the re-organization of the VCL to support CLX in Kylix.