Delphi

Delphi Application.CreateForm is the Handle Unique for each Form?

廉价感情. 提交于 2020-01-25 09:13:11
问题 I have a TreeList , with many Items , each item has it's own unique ID . I allow the user to open multiple IDs at once . But I would like to prevent the user from opening the same ID twice . So I thought about creating a simple Dynamic Array where I store which TreeList ID is connected to which Form HWND . If I find a ID on my list with a Matching HWND, then I simply bring the Form which is already Created to Foreground. Application.CreateForm(TChapter, Chapter); Chapter.PopupParent:=Main;

Trying to compile iOS device 64-bit in Delphi

狂风中的少年 提交于 2020-01-25 08:27:04
问题 I'm using Delphi 10.2 Update 3, with an iOS target of 11.3 and an iPad running iOS 10.3.3. When I try to compile my project for a iOS device, this error occurs: [DCC Error] E2597 ld: warning: directory not found for option '-FC:\Users\gustavo.reinert\Documents\Embarcadero\Studio\SDKs\iPhoneOS11.3.sdk\System\Library\PrivateFrameworks' ld: warning: directory not found for option '-LC:\Users\Marcio.Amorim\Documents\Embarcadero\Studio\SDKs\MacOSX10.13.sdk\usr\lib\system' ld: file not found: /usr

Parsing full JSON into SQL

守給你的承諾、 提交于 2020-01-25 08:10:06
问题 I have the following JSON (only a couple of nodes for display purposes): [ { "CareNotes": [ { "CareNoteID": "34289e11-6433-4020-9734-224eb8caa11a", "CareNoteExtendedID": "00000000-0000-0000-0000-000000000000", "ADLName": "Mobility", "FlagsText": "", "Note": "Help with walking, used as four wheel walker, was content.", "AnswerType": 1, "Fragment": "Help with walking", "RemedialText": null, "Details": null, "ServiceUserID": "bc300962-3653-491a-9ba9-afab10964af4", "ServiceUser": "Betty Test",

How to use SO_KEEPALIVE with TServerSocket?

故事扮演 提交于 2020-01-25 07:43:26
问题 Does the component has a set option property or i need to use setsockopt function ? i want to enable the os built in Keep-alive instead of me having to write it myself... -.-" so, my question is, inside the constructor where i create the instance of TServerSocket, how do i then enable this SO_KEEPALIVE option ? thanks everyone. 回答1: You can use setsockopt to set SO_KEEPALIVE implementation uses WinSock; {$R *.dfm} procedure TForm2.ClientConnect(Sender: TObject; Socket: TCustomWinSocket); var

IdTcpServer some times don't retrieve the informations at Disconnect event

青春壹個敷衍的年華 提交于 2020-01-25 06:48:30
问题 I don't know why but sometimes when disconnect event on log he don't retrieve the ip and hostname, maybe because already disconnected before retrieve the informations? and if yes how solve it? procedure TForm1.IdTCPServer1Connect(AContext: TIdContext); var DadosConexao : TClient; begin DadosConexao := TClient(AContext); DadosConexao.PeerIP := AContext.Connection.Socket.Binding.PeerIP; DadosConexao.HostName := GStack.HostByAddress(DadosConexao.PeerIP); DadosConexao.Connected := Now;

Adding object methods to a stringlist so they can be invoked by name

南笙酒味 提交于 2020-01-25 06:15:28
问题 I have server code than accepts commands from clients and executes object methods, as determined by the command received. I want to build a stringlist using AddObject to associate the command with the desired procedure. This works fine with standalone procedures but I get "variable required" errors when trying to add object methods to my stringlist. Here's example code: type TExample = class public var Commands: TStringList; constructor Create; destructor Destroy; override; procedure

Adding object methods to a stringlist so they can be invoked by name

旧巷老猫 提交于 2020-01-25 06:14:09
问题 I have server code than accepts commands from clients and executes object methods, as determined by the command received. I want to build a stringlist using AddObject to associate the command with the desired procedure. This works fine with standalone procedures but I get "variable required" errors when trying to add object methods to my stringlist. Here's example code: type TExample = class public var Commands: TStringList; constructor Create; destructor Destroy; override; procedure

Windows & Mac XML library for delphi XE2

独自空忆成欢 提交于 2020-01-25 06:12:11
问题 What is the best (easy to use, performances) library to manage XML on Delphi XE2. Windows and Mac targets in mind. 回答1: You can use OmniXML, it is: 100% written in delphi Has no outer dependencies Works on XE2, did not test it on OSX On top of OmniXML you can use SimpleStorage to give you more power and simplicity managing the XML. 回答2: I usually go for the NativeXML library, it's an XML library completely written in Delphi code and it's free. I'm not sure if the latest version offers

How to explain access violation in RtlLeaveCriticalSection

浪尽此生 提交于 2020-01-25 05:07:08
问题 I have an application that requests data from a database triggered by a timer on a form. If there is an error (the connection to the database is lost), I sometimes I get the expected exception (EIBO_ISCError) and sometimes I get an access violation in RtlLeaveCriticalSection of ntdll.dll. Here is the corresponing Eurekalog stack: ------------------------------------------------------------------------------------------------------ |Adresse |Modul |Unit |Klasse |Prozedur/Methode |Zeile | -----

Delphi Web Script: How to find the Class Name of a Script-TClass in Delphi

我怕爱的太早我们不能终老 提交于 2020-01-25 04:20:12
问题 Imagine this procedure, which is callable in a script: // Foo is not implemented in the Script but via Delphi procedure Foo(ClassType: TClass); The Script looks like that: type TMyClass = class end; Foo(TMyClass); When Foo gets called my Delphi App sees an Int64-Value for the ClassType. e.g. Foo(661259635); You can see in the DWS sources that a TClass is explicitly converted to an Int64 (see dwsCompiler.pas, procedure TObjectClassTypeMethod.Execute -> Info.ResultAsInteger := Int64(info