Delphi

Method called on thread using Synchronize does not return without moving the mouse

帅比萌擦擦* 提交于 2021-02-08 12:16:37
问题 I have a unit and form which uses a worker thread to query a database. After each query is executed a method is called using Synchronize to update the UI. It seems that whenever a call to the methods using Synchronize() is made, the process stops until I shake the mouse or interact with the keyboard. Below is the basics of what I am doing. This example is complete other than that I did not provide a database connection or queries for a real database- I am hoping it will be enough to see the

Method called on thread using Synchronize does not return without moving the mouse

孤街浪徒 提交于 2021-02-08 12:14:42
问题 I have a unit and form which uses a worker thread to query a database. After each query is executed a method is called using Synchronize to update the UI. It seems that whenever a call to the methods using Synchronize() is made, the process stops until I shake the mouse or interact with the keyboard. Below is the basics of what I am doing. This example is complete other than that I did not provide a database connection or queries for a real database- I am hoping it will be enough to see the

Execute FireDAC connection editor at run time

不问归期 提交于 2021-02-08 11:08:17
问题 I would like to execute FireDAC connection editor at run time, but haven't found which class is the Component Editor for TFDConnection . For example, it is easy to find out which class is the Component Editor for TADOConnection. 回答1: You can excute FireDac connection editor by calling Execute method of TfrmFDGUIxFormsConnEdit which you can find it in FireDAC.VCLUI.ConnEdit unit. Here is an example how to do it: Uses ... FireDAC.VCLUI.ConnEdit; .. var FDConnEditor : TfrmFDGUIxFormsConnEdit;

Execute FireDAC connection editor at run time

 ̄綄美尐妖づ 提交于 2021-02-08 11:07:36
问题 I would like to execute FireDAC connection editor at run time, but haven't found which class is the Component Editor for TFDConnection . For example, it is easy to find out which class is the Component Editor for TADOConnection. 回答1: You can excute FireDac connection editor by calling Execute method of TfrmFDGUIxFormsConnEdit which you can find it in FireDAC.VCLUI.ConnEdit unit. Here is an example how to do it: Uses ... FireDAC.VCLUI.ConnEdit; .. var FDConnEditor : TfrmFDGUIxFormsConnEdit;

Checksum an image in Delphi

↘锁芯ラ 提交于 2021-02-08 10:53:35
问题 I am trying to checksum an image, but it takes too long to give a result, tried add values, and Adler-32 but both finishes in a long time (approximately 2 seconds). Adding values: Function Checksum_CountryFlag(Img : TPicture):Integer; var j, k, Checksum : Integer; begin Checksum := 0; For j := 0 to Img.Width do For k := 0 to Img.Height do If (((Img.Bitmap.Canvas.Pixels[j,k]) <> 15577344) And ((Img.Bitmap.Canvas.Pixels[j,k]) <> 15311104) And ((Img.Bitmap.Canvas.Pixels[j,k]) <> 3816255) And (

HTTP Authorization in SOAP delphi

时光毁灭记忆、已成空白 提交于 2021-02-08 10:52:39
问题 I am trying to send a request to web service, this is the WSDL: http://www.smsmelli.com/class/sms/webservice/server.php?wsdl after long researching I underestand untyped array should replace with array of array of string; till here, it solved, but I realize my SOAP doesn't work properly. I check PHP action that works exactly same, then I find it sets Credential in Authentication in the header of HTTP from SOAP; in WireShark: -HyperText Transfer Protocol --Authorization: Basic Y3LIZ577838sdf=

Checksum an image in Delphi

冷暖自知 提交于 2021-02-08 10:52:11
问题 I am trying to checksum an image, but it takes too long to give a result, tried add values, and Adler-32 but both finishes in a long time (approximately 2 seconds). Adding values: Function Checksum_CountryFlag(Img : TPicture):Integer; var j, k, Checksum : Integer; begin Checksum := 0; For j := 0 to Img.Width do For k := 0 to Img.Height do If (((Img.Bitmap.Canvas.Pixels[j,k]) <> 15577344) And ((Img.Bitmap.Canvas.Pixels[j,k]) <> 15311104) And ((Img.Bitmap.Canvas.Pixels[j,k]) <> 3816255) And (

LowLevelKeyboardProc() never is executed

回眸只為那壹抹淺笑 提交于 2021-02-08 10:40:37
问题 I'm need hook my keyboard and found the following code (reference here) that i want use in a Delphi Console project. Happens that after the first test i noted that LowLevelKeyboardProc() function never is executed ( hello never is displayed on console window). Already SetWindowsHookEx() is working fine and returning <> 0. Then someone can help me to solve this problem please? program Project1; {$APPTYPE CONSOLE} {$R *.res} uses Windows, Messages, SysUtils; function ToUnicodeEx(wVirtKey,

Delphi - application hangs while ShowMessage or MessageDlg

a 夏天 提交于 2021-02-08 09:14:42
问题 why the application hangs when Executing Thread and that thread have ShowMessage or MessageDlg but when using MessageBox everything is working normally. all this happened if the application Appearance not the defualt one >> " Windows " if the selected Appearance " Windows " it will never hangs even with the ShowMessage and MessageDlg 回答1: ShowMessage() and MessageDlg() are not thread-safe. They display VCL Forms, which must only be used in the context of the main UI thread. Windows.MessageBox

How to Auto Update the CheckState of the parent nodes When Child's Changed Programmingly?

a 夏天 提交于 2021-02-08 09:12:59
问题 I am using Delphi XE3 with Virtual TreeView. I have enabled the toAutoTristateTracking option. WHen I try to change the check state of a node manually, then the affected node's checkstate will change as well. However, when I do the same thing programmingly, for example PNode^.CheckState := csMixedNormal; or PNode^.CheckState := csCheckedNormal; Only PNode check state will be changed. The affected nodes will not change their states. Why? 回答1: Don't access CheckState of a node directly. Use