Rodrigo Baltazar Posted July 6, 2023 Share Posted July 6, 2023 I created a thread, but when I use the Synchronize command to synchronize with the main mainform, it returns an access violation error. Synchronize( procedure begin mainform.labSales.Caption:= FormatFloat('0,.00', StrToFloat(Qry.FieldByName('VALORPAGOS').AsString)); end); What am I doing wrong? Grateful Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 6, 2023 Share Posted July 6, 2023 Hello, Do you want to update the caption? But why in this way? Quote Link to comment Share on other sites More sharing options...
Rodrigo Baltazar Posted July 6, 2023 Author Share Posted July 6, 2023 It's updating a dashboard. I would like to read the queries in the thread and only update at the end when everything has been done. grateful Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 6, 2023 Share Posted July 6, 2023 1 hour ago, Rodrigo Baltazar said: It's updating a dashboard. I would like to read the queries in the thread and only update at the end when everything has been done. You can also see demos: \FMSoft\Framework\uniGUI\Demos\Desktop\ThreadTimer... Quote Link to comment Share on other sites More sharing options...
Rodrigo Baltazar Posted July 6, 2023 Author Share Posted July 6, 2023 3 hours ago, Sherzod said: Você também pode ver demonstrações: OK everything that plays inside the timer thread will be considered a thead then. I understood. Thanks! Quote Link to comment Share on other sites More sharing options...
asapltda Posted July 7, 2023 Share Posted July 7, 2023 try please Synchronize( procedure begin mainform.labSales.Caption:= FormatFloat('0,.00', Qry.FieldByName('VALORPAGOS').Asfloat); end); Quote Link to comment Share on other sites More sharing options...
Tokay Posted July 7, 2023 Share Posted July 7, 2023 19 hours ago, Rodrigo Baltazar said: I created a thread, but when I use the Synchronize command to synchronize with the main mainform, it returns an access violation error. Synchronize( procedure begin mainform.labSales.Caption:= FormatFloat('0,.00', StrToFloat(Qry.FieldByName('VALORPAGOS').AsString)); end); What am I doing wrong? Grateful Syncronize with main thread does not needed and does not help in the Unigui. I've send solution for such cases, you can try find it. The search key 'UniServerModule.GetSession'. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.