In an application I comunicate with a mobile device. If the device is not in the dockingstation it is possible, that calling a function will respond after a timeout of i.e. 60 seconds. So my idea was to program this in a thread.
TPdaSyncThread = class(TThread)
procedure Execute; override;
constructor Create(... myParams);
constructor TPdaSyncThread.Create(... myParams);
FreeOnTerminate := True;
Sleep(30000); //just to "simulate" calling the function that will return after a timeout
while not Terminated do
In the main-thread I have a procedure "AppMessage" (Application.Onmessage := "AppMessage". During the 30 seconds (sleep) this procedure is never called. I think I didn't understand something with threading??