Delphi

How to get the current project name in Delphi directories settings?

社会主义新天地 提交于 2020-02-02 14:50:50
问题 In the project directory settings, I often need to use the project name, say 'MyProject' , as part of the output paths. I would prefer to avoid hardcoding the project name in the settings. Is there a variable, like $(Config) and $(Platform) , to dynamically obtain the current project name (without extension)? 回答1: You can use $(SanitizedProjectName) for this purpose. Be aware that the debugger might not support that. 来源: https://stackoverflow.com/questions/58461383/how-to-get-the-current

Firemonkey TCameraComponent quality change when reactivated

和自甴很熟 提交于 2020-02-02 13:19:53
问题 I'm building a barcode reader application in Delphi 10.1 Berlin with firemonkey for Android. Based on the CameraComponent sample and using the ZXing library, it was possible to read the barcode. To initialize the camera, I'm using this code: procedure TfrmMain.btnOpenReaderClick(Sender: TObject); begin CameraComponent.Active := False; CameraComponent.FocusMode := FMX.Media.TFocusMode.ContinuousAutoFocus; CameraComponent.Quality := TVideoCaptureQuality.MediumQuality; CameraComponent.Active :=

Delphi: Calling a function from a vc++ dll that exports a interface / class

跟風遠走 提交于 2020-02-02 12:52:18
问题 i have some trouble accessing a dll written in vc++ that exports an interface. First i tried to use classes, but after some google-search i came to the solution, that this i not possible. I just want to make sure, that the plugin interface can accessed, by using other languages like c++. Delphi Interface IPlugIn = interface function GetName: WideString; stdcall; end; Delphi Plugin call procedure TForm1.Button5Click(Sender: TObject); var hLib: Cardinal; MLoadPlugIn: TLoadPlugIn; PlugIn:

How can I display a form for set configuration before the main form?

大兔子大兔子 提交于 2020-02-02 11:57:31
问题 in my project i have two form's(form1,form2), form1 is configuration form. i want to show Form1 and when we click Button1 then show Form2 and free(Release) Form1. how can to i do this? i use this code. but this project start and then exit automatically.A Friend said because the application message loop never start, and application terminates because main form does not exist. how i can to solve this problem? uses Unit2; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin

reset rad studio settings without uninstalling it

你说的曾经没有我的故事 提交于 2020-02-02 11:56:56
问题 I use Delphi xe7 update 1 and I noticed something weird today with the code editor. the ide starts typing from another position instead of my current cursor position. I don't have any ide enhancement tools installed. is there anyway I can reset rad studio settings to default without uninstalling it? 回答1: I can't think of any editor setting that would cause that behavior. Any kind of reset is going to clear all of the changes to the IDE configuration, including uninstalling all third-party

How can I display a form for set configuration before the main form?

孤者浪人 提交于 2020-02-02 11:55:11
问题 in my project i have two form's(form1,form2), form1 is configuration form. i want to show Form1 and when we click Button1 then show Form2 and free(Release) Form1. how can to i do this? i use this code. but this project start and then exit automatically.A Friend said because the application message loop never start, and application terminates because main form does not exist. how i can to solve this problem? uses Unit2; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin

reset rad studio settings without uninstalling it

我的梦境 提交于 2020-02-02 11:54:48
问题 I use Delphi xe7 update 1 and I noticed something weird today with the code editor. the ide starts typing from another position instead of my current cursor position. I don't have any ide enhancement tools installed. is there anyway I can reset rad studio settings to default without uninstalling it? 回答1: I can't think of any editor setting that would cause that behavior. Any kind of reset is going to clear all of the changes to the IDE configuration, including uninstalling all third-party

reset rad studio settings without uninstalling it

五迷三道 提交于 2020-02-02 11:54:27
问题 I use Delphi xe7 update 1 and I noticed something weird today with the code editor. the ide starts typing from another position instead of my current cursor position. I don't have any ide enhancement tools installed. is there anyway I can reset rad studio settings to default without uninstalling it? 回答1: I can't think of any editor setting that would cause that behavior. Any kind of reset is going to clear all of the changes to the IDE configuration, including uninstalling all third-party

How can I display a form for set configuration before the main form?

假装没事ソ 提交于 2020-02-02 11:53:22
问题 in my project i have two form's(form1,form2), form1 is configuration form. i want to show Form1 and when we click Button1 then show Form2 and free(Release) Form1. how can to i do this? i use this code. but this project start and then exit automatically.A Friend said because the application message loop never start, and application terminates because main form does not exist. how i can to solve this problem? uses Unit2; {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin

How to use generics as a replacement for a bunch of overloaded methods working with different types?

久未见 提交于 2020-02-02 07:36:44
问题 I have a bunch of overloaded methods, all of them get an array of some type as a parameter and return a random value from that array: function GetRandomValueFromArray(Arr: array of String): String; overload; begin Result := Arr[Low(Arr) + Random(High(Arr) + 1)]; end; function GetRandomValueFromArray(Arr: array of Integer): Integer; overload; begin Result := Arr[Low(Arr) + Random(High(Arr) + 1)]; end; etc. How can I use generics to create a single method for array of any type? Something like