rad-studio

“Emergency” termination of omnithread IOmniParallelTask

…衆ロ難τιáo~ 提交于 2021-02-08 06:52:13
问题 Background I have a unit test in which I check if my handler code code performs well during multi-thread stress: procedure TestAppProgress.TestLoopedAppProgressRelease_SubThread; begin var bt:=Parallel.ParallelTask.NumTasks(1).NoWait.Execute( procedure begin SetWin32ThreadName('TestLoopedAppProgressRelease_SubThread'); RunLoopedAppProgressRelease; end ); lSuccess:=bt.WaitFor(cRunLoopTimerMilliSecs*2); if not lSuccess then bt.Terminate; // emergency termination, unit test failed <<< How do I

“Emergency” termination of omnithread IOmniParallelTask

北战南征 提交于 2021-02-08 06:50:38
问题 Background I have a unit test in which I check if my handler code code performs well during multi-thread stress: procedure TestAppProgress.TestLoopedAppProgressRelease_SubThread; begin var bt:=Parallel.ParallelTask.NumTasks(1).NoWait.Execute( procedure begin SetWin32ThreadName('TestLoopedAppProgressRelease_SubThread'); RunLoopedAppProgressRelease; end ); lSuccess:=bt.WaitFor(cRunLoopTimerMilliSecs*2); if not lSuccess then bt.Terminate; // emergency termination, unit test failed <<< How do I

“Emergency” termination of omnithread IOmniParallelTask

这一生的挚爱 提交于 2021-02-08 06:50:21
问题 Background I have a unit test in which I check if my handler code code performs well during multi-thread stress: procedure TestAppProgress.TestLoopedAppProgressRelease_SubThread; begin var bt:=Parallel.ParallelTask.NumTasks(1).NoWait.Execute( procedure begin SetWin32ThreadName('TestLoopedAppProgressRelease_SubThread'); RunLoopedAppProgressRelease; end ); lSuccess:=bt.WaitFor(cRunLoopTimerMilliSecs*2); if not lSuccess then bt.Terminate; // emergency termination, unit test failed <<< How do I

Delphi FreeAndNil: Looking for an alternate implementation

偶尔善良 提交于 2020-12-05 12:24:53
问题 NOTE: Bear with me, I feel a little "flame grilled" due to some discussions over here and here and some issues I reported here and here. Some background Ye olde (pre 10.4) FreeAndNil looked like this: FreeAndNil(var SomeObject) The new and fresh FreeAndNil looks like this: FreeAndNil(const [ref] SomeObject: TObject); IMO both have their downsides: The old one doesn't do any type checking, so calling FreeAndNil on pointers, records and interfaces compiles just fine, but produces interesting

Delphi FreeAndNil: Looking for an alternate implementation

微笑、不失礼 提交于 2020-12-05 12:23:11
问题 NOTE: Bear with me, I feel a little "flame grilled" due to some discussions over here and here and some issues I reported here and here. Some background Ye olde (pre 10.4) FreeAndNil looked like this: FreeAndNil(var SomeObject) The new and fresh FreeAndNil looks like this: FreeAndNil(const [ref] SomeObject: TObject); IMO both have their downsides: The old one doesn't do any type checking, so calling FreeAndNil on pointers, records and interfaces compiles just fine, but produces interesting

Is there an equivalent of Indy 9's ReadBuffer() in Indy 10?

戏子无情 提交于 2019-12-25 17:14:29
问题 This code is written in Borland C++Builder 6 using Indy 9: void __fastcall TfrmMain::ServerConnect(TIdPeerThread *AThread) { BKUK_PACKET Pkt; ----------(中略)--------------------------------------- AThread->Connection->ReadBuffer((BYTE *)&Pkt,sizeof(BKUK_PACKET)); ----------(中略)--------------------------------------- } The function named ReadBuffer() is not found in Indy 10. Is there an equivalent function? BKUK_PACKET is a structure of about 1200 bytes. typedef struct _BKUK_PACKET_ { BYTE head

Why TText Trimming does not work when WordWrap is enabled in Firemonkey?

假如想象 提交于 2019-12-20 05:41:38
问题 I'm using Rad Studio 10.2.3. In my form when I have a TText with long content, I set WordWrap property to "True" and Trimming property to "Word". In design time everything looks good but in runtime and in android platform there is a problem as shown in the picture: What should I do to avoid this? Update: I installed RAD Studio 10.3 Rio and tried again. Now the meaningless characters are gone but the trimming problem is still there, just like the image below: 回答1: This is a known bug and it

how to return TByteDynArray in SqlServerMethod DataSnap Server

我的未来我决定 提交于 2019-12-13 08:26:05
问题 I have a DataSnap Server with a Server method like this: function TServerMethods1.Get_Excel_History(key: string): TByteDynArray; Now, on the DataSnap Client using TSQLServerMethod, I successfully connect to the server in Design Mode, and I'm sending the request to Server and successfully receiver the data but can not read the output parameter. M.SqlServerMethod1.Close; M.ClientDataSet_All.Close; M.SqlServerMethod1.ServerMethodName:='TServerMethods1.Get_XML_History'; M.SqlServerMethod1.Params