Larry2023 0 Posted May 12, 2023 I have a function that uses TRESTClient (and associated classes) in an EXE. The function works great in the EXE. I am attempting to move that function to a thread in a console app (later this will be a service). I created a new class MyService = class(TThread). The application flow is: Start console app. Create MyService From MyService.Excute call the function (good so far) In the function: Run an ADO query (this works) Create the TRESTClient (and associated objects). These are created dynamically. Call the TRESTRequest.Execute method. In TRESTRequest.Execute the entire application appears to hang. Anyone have any pointers? Thx! Share this post Link to post
Uwe Raabe 2133 Posted May 12, 2023 5 minutes ago, Larry2023 said: to move that function to a thread in a console app So you should check this hint in the docs: Quote In a non-GUI application, you must call CheckSynchronize if you use the Synchronize method of TThread. In case you didn't change The SynchronizedEvents property of the TRESTRequest, it internally calls Synchronize, which forces you to obey the above. Share this post Link to post
Larry2023 0 Posted May 12, 2023 Ahh I missed that. Thank you very much! Big help! Works great now. Share this post Link to post