delphi-10-seattle

What is the correct way to structure this generic object creation

白昼怎懂夜的黑 提交于 2020-01-06 19:45:35
问题 Ignoring the fact that this uses the Aurelius Framework, this question is more about how I need to re-tweak the code to make the generic constructor injection work for both type: < string > and < TCustomConnection > Also ignore the fact that the child objects are in the same unit, I would generally put them in their own, but this just makes it easier to post in a question. I'm trying use the Factory Method pattern to determine what type of connection it should be making at runtime depending

Unexpected failure of custom registered Reverter using TJSONUnMarshal

微笑、不失礼 提交于 2020-01-02 08:58:32
问题 The code below is from the JSonMarshall project in chapter 7 of Marco Cantu's Delphi 2010 Handbook. The source code is available from here http://cc.embarcadero.com/item/27600. I have made two changes to it: Add JSon to the implementation Uses clause to get it to compile. Added the line theName := 'XXX'; // added by me to the TDataWithList.Create constructor to assist debugging I am running the code in Delphi Seattle (without update 1) The purpose of the project is to demo a custom converter

Unexpected failure of custom registered Reverter using TJSONUnMarshal

女生的网名这么多〃 提交于 2020-01-02 08:58:30
问题 The code below is from the JSonMarshall project in chapter 7 of Marco Cantu's Delphi 2010 Handbook. The source code is available from here http://cc.embarcadero.com/item/27600. I have made two changes to it: Add JSon to the implementation Uses clause to get it to compile. Added the line theName := 'XXX'; // added by me to the TDataWithList.Create constructor to assist debugging I am running the code in Delphi Seattle (without update 1) The purpose of the project is to demo a custom converter

VirtualKeyboard not Show when focus Edit fields in Firemonkey project

旧街凉风 提交于 2019-12-31 05:14:53
问题 I have a Firemonkey multi device project in Delphi 10 Seattle where the user can get a screen at the start of the app. Here the user needs to fill in 2 fields. But when I click on the edit fields the Virtual Keyboard isn't shown. If I skip this screen at start and call it later then the Virtual Keyboard is shown. This is done in the same way too. I found sort of a solution: When i click on the edit fields i call show VirtualKeyboard myself. The only problem is that the cursor isn't shown in

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

雨燕双飞 提交于 2019-12-31 03:53:10
问题 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.

E2045 Bad object file Format:“XXX.obj”

最后都变了- 提交于 2019-12-25 17:17:22
问题 I am working on one migration project from x32 bit to x64 . Here I am using this code: {$L com_1.obj} {$L com_is1.obj} {$L com_2.obj} But while compiling code I am getting error as [dcc64 Error] XXX.dpr(919): E2045 Bad object file format: 'E:\MyProj\com_sha.obj' I am not able to trace why it is happening. Is it due to 32 bit obj file used for compiling x64 bit delphi project? If it is I have also tried to create a obj file with x64 bit environment. Can anyone please help me on this? I am

How can I set the default system style in Delphi 10 Seattle?

孤者浪人 提交于 2019-12-24 11:55:24
问题 I am trying to port some code that works in Delphi XE8 to Delphi 10 Seattle. This code sets the default system style of my program, but the SetSystemStyle method does not exist in the Delphi 10 Seattle. TStyleManager.SetSystemStyle(Self); 回答1: I added the Default_Style_Block_Pointer: TMemoryStream; to the MainForm Var: block I placed this code in the MainForm.OnCreate event: Default_Style_Block_Pointer:=TMemoryStream.Create; TStyleStreaming.SaveToStream(TStyleManager.ActiveStyle(Self),Default

Resize images and save output

旧城冷巷雨未停 提交于 2019-12-24 08:04:47
问题 I see many questions/Answers about resizing images here on SO. But I can't find the correct one that fit my case. In this post , it works only when you want to have a small image from a big one. However if you have a picture with 24x24 dimension and you want to resize it to 256x256 dimension, the procedure will fail and gives you a distorted picture. The code below is my attempt to sort out my issue Graph := TBitmap.Create; try // After loading a .bmp file to Image1 with 48x48 dimension Graph

Delphi PATH error on Android compiler

雨燕双飞 提交于 2019-12-24 07:43:50
问题 I have just installed Delphi 10 Seattle in a DELL workstation of my office and I am able to compile 32 bit and 64 bit. When I select Android I have this kind of error: [Exec Error] The command "PATH C:\Program Files\Java\jdk1.7.0_71\bin;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE7\IDE_spoof;C:\Program Files (x86)\Embarcadero\Studio\17.0\bin; [... more lines ...];exited with code 1. I guessed that this was a misconfiguration and so I have checked the IDE options. As you

Delphi PATH error on Android compiler

北城以北 提交于 2019-12-24 07:43:04
问题 I have just installed Delphi 10 Seattle in a DELL workstation of my office and I am able to compile 32 bit and 64 bit. When I select Android I have this kind of error: [Exec Error] The command "PATH C:\Program Files\Java\jdk1.7.0_71\bin;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE7\IDE_spoof;C:\Program Files (x86)\Embarcadero\Studio\17.0\bin; [... more lines ...];exited with code 1. I guessed that this was a misconfiguration and so I have checked the IDE options. As you