delphi-10-seattle

Deleting an FMXobject inside its event handler

半城伤御伤魂 提交于 2019-12-02 08:17:16
I have the following components, tncrdragdata ( tframedscrollbox ) tdragdata ( tgroupbox ) The main Idea is to combine them and use them as a list box (I need it this way). The groupbox contains five tedit , one tcombobox and one tbutton . The problem is when I try to free the tdragdata inside its event handler. I use the FreeNotification method to relocate the group boxes in the framedscrollbox . The problem is that the overridden notification method is executed twice for some reason I don't know. My question is: Why the overridden method is executed twice? If I remove the condition (self

How to check if a service is running in Delphi 10 Seattle

心不动则不痛 提交于 2019-12-02 08:04:53
The consensus (most votes) for Java developers seems to be private boolean isMyServiceRunning(Class<?> serviceClass) { ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { if (serviceClass.getName().equals(service.service.getClassName())) { return true; } } return false; } But I am a Delphi developer working with 10 Seattle. I got this far in coding my function, and got stuck. What is r ? The Androidapi.JNI.App.pas includes the JActivityManager and the getRunningServices method

Exception with German Umlaut characters in TMemIniFile.Create

旧巷老猫 提交于 2019-12-02 07:18:33
I have an .URL file which contains the following text which contains a German Umlaut character: [InternetShortcut] URL= http://edn.embarcadero.com/article/44358 [MyApp] Notes=Special Test geändert Icon=default Title=Bug fix list for RAD Studio XE8 I try to load the text with TMemIniFile : uses System.IniFiles; // procedure TForm1.Button1Click(Sender: TObject); var BookmarkIni: TMemIniFile; begin // The error occurs here: BookmarkIni := TMemIniFile.Create('F:\Bug fix list for RAD Studio XE8.url', TEncoding.UTF8); try // Some code here finally BookmarkIni.Free; end; end; This is the error

Exception with German Umlaut characters in TMemIniFile.Create

可紊 提交于 2019-12-02 07:13:43
问题 I have an .URL file which contains the following text which contains a German Umlaut character: [InternetShortcut] URL=http://edn.embarcadero.com/article/44358 [MyApp] Notes=Special Test geändert Icon=default Title=Bug fix list for RAD Studio XE8 I try to load the text with TMemIniFile : uses System.IniFiles; // procedure TForm1.Button1Click(Sender: TObject); var BookmarkIni: TMemIniFile; begin // The error occurs here: BookmarkIni := TMemIniFile.Create('F:\Bug fix list for RAD Studio XE8.url

Is there a difference between TParallel.&For and TParallel.For?

陌路散爱 提交于 2019-12-01 03:57:19
Is there a difference between TParallel.&For and TParallel.For ? Both can be compiled in Delphi 10 Seattle. so which one should I stick to? The method definition for TParallel.&For requires the ampersand to escape a reserved word ( for ). You don't need to use it when calling the method except in cases where there would be ambiguity. For example : with TParallel do begin &For(...) // etc end; I can't imagine why you would ever want to do that, however. If it were in one of your own classes, mind you, any internal calls to an escaped method would require either the ampersand or an explicit

Reporting memory leaks on shutdown with a console application

岁酱吖の 提交于 2019-12-01 02:19:33
问题 I've created a console application and set ReportMemoryLeaksOnShutdown := True. I've created a TStringList but did not free it. When the program finishes executing, I see the memory leak for a brief second but then the console closes. I've tried adding a ReadLn; to the end, but it only shows a blank console window when I do that, which makes sense. I need to find a way to pause executing after the memory leak report, but before complete program shutdown. I'm using Delphi 10 Seattle. program

How to use threads with idhttp in delphi 10

梦想的初衷 提交于 2019-12-01 01:30:35
i need help to speedup my project,i have 2 ListBoxs, the first is full with URLs, the second i store in it the URLs that causes 404 error from Listbox1, its just checking process. the idhttp takes about 2s to check 1 url, i dont need the html, cause the decryption process takes time, So i decided to add threads in my project, my code so far unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, IdSSLOpenSSL, Vcl.StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP;

Is there a difference between TParallel.&For and TParallel.For?

百般思念 提交于 2019-12-01 00:52:53
问题 Is there a difference between TParallel.&For and TParallel.For ? Both can be compiled in Delphi 10 Seattle. so which one should I stick to? 回答1: The method definition for TParallel.&For requires the ampersand to escape a reserved word ( for ). You don't need to use it when calling the method except in cases where there would be ambiguity. For example : with TParallel do begin &For(...) // etc end; I can't imagine why you would ever want to do that, however. If it were in one of your own

How to use threads with idhttp in delphi 10

折月煮酒 提交于 2019-11-30 20:51:47
问题 i need help to speedup my project,i have 2 ListBoxs, the first is full with URLs, the second i store in it the URLs that causes 404 error from Listbox1, its just checking process. the idhttp takes about 2s to check 1 url, i dont need the html, cause the decryption process takes time, So i decided to add threads in my project, my code so far unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl

Why can't I assign my function reference to a matching variable? E2555 is raised

一曲冷凌霜 提交于 2019-11-30 11:29:29
I'm trying to build an custom comparer which allows the assignment of the comparison function to an internal field. In order to ease the creation of the comparer, I tried to add a constructor-like class function Construct which initializes the comparer. Now if I try to compile the following example, the compiler displays [dcc32 Fehler] ConsoleDemo1.dpr(37): E2555 Symbol 'Result' cannot be tracked I have the following example-code: program ConsoleDemo1; {$APPTYPE CONSOLE} {$R *.res} uses Generics.Collections, Generics.Defaults, System.SysUtils; type TConstFunc<T1, T2, TResult> = reference to