Delphi

How to detect Form Resize END, maybe by using the TApplicationEvents component?

夙愿已清 提交于 2021-02-16 21:30:49
问题 In a Delphi 10.4 VCL Application, I need to detect when the FORM RESIZING ENDS . (E.g. after the user resized the Form by dragging its size-grip). So I have placed a TApplicationEvents component on the form and created its OnMessage event-handler, trying to catch the WM_EXITSIZEMOVE message: procedure TformMain.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); begin if (Msg.Message = WM_EXITSIZEMOVE) then begin CodeSite.Send('TformMain.ApplicationEvents1Message: WM

Creating a Delphi IoC. How to disable Delphi's linker from removing unused classes

[亡魂溺海] 提交于 2021-02-16 16:23:06
问题 I've created a IoC in delphi with the ability to automatically register any classes that have a IocSingletonAttribute to it. The AutoRegister looks like the following. procedure TIocContainer.AutoRegister; var ctx: TRttiContext; rType: TRttiType; attr: TCustomAttribute; &Type: PTypeInfo; begin ctx := TRttiContext.Create; for rType in ctx.GetTypes do Begin for attr in rType.GetAttributes do Begin if TypeInfo(IocSingletonAttribute) = attr.ClassInfo then Begin &Type := IocSingletonAttribute(attr

How to specify File Version when building EXE using MSBuild?

为君一笑 提交于 2021-02-16 15:15:08
问题 I'm trying to compile an EXE using MSBuild / Delphi 2010, I tried this: MSBuild.exe /t:Clean;Build /p:config=Release;ExtraDefines="CodeTest" /property:FileVersion=1.0.0.15 "D:\MyProject\MyFile.dproj" File is built but version isn't set What's wrong anyway? 回答1: Your property "FileVersion" is available inside the MSBuild session, but unless you have a Task or Target that uses it somehow, it's not being used for anything. You'll either need to (as DHeffernan says) create a version resource that

inline var bug with anonymous procedure?

▼魔方 西西 提交于 2021-02-16 13:56:12
问题 with the code below: Procedure TMyForm.doAction; begin generateToken; VAR LToken := generatedToken; // Ltoken is set correctly to xxxxx //----- TThread.CreateAnonymousThread( procedure begin GetData(LToken); // << here LToken is empty !! end).Start; end; As you can see, the value of LToken is empty inside the anonymous procedure (so the capture didn't work). if I don't use inline var for LToken then it's work Procedure TMyForm.doAction; Var LToken: ansiString; begin .... end; Is this a bug or

Get the Middle/Beginning/End arabic char in string

有些话、适合烂在心里 提交于 2021-02-16 05:29:51
问题 Most of the Arabic letters have multiple contextual forms for example the latter ب has general unicode 0628 . But if latter come in the beginning of word will take this form بـ‎ unicode FE91 . Middle = ـبـ‎ unicode FE92 . End of the word = ـب‎‎ unicode FE90 . I'm trying to get the char code but i always get the general unicode. procedure TfMain.btn2Click(Sender: TObject); const Str = 'يبداء'; Ch = 'ب'; begin ShowMessage(IntToHex(Ord(Ch), 4)); // return 0628 - Correct ShowMessage(IntToHex(Ord

iOS crash log 分析。

不想你离开。 提交于 2021-02-14 08:57:24
背景 使用Delphi开发的APP,提交到App Store审核,结果被拒,并且反馈一个crashlog文件。这个log文件中包含APP基本信息和十六进制的日志,无从下手。 如何看懂这个日志文件 使用symbolicatecrash工具,这个工具应该是Xcode工具自带的。 根据XCode版本的不同,该工具的位置也不同。但是可以使用命令查找 find /Applications/Xcode.app -name symbolicatecrash -type f //可能会找到多条,但是使用/Applications/Xcode.app/Contents/SharedFrameworks下的即可。 1.在桌面上创建一个CrashReport文件夹。 2.将symbolicatecrash拷贝到1的文件夹内。 3.将打包时的appName.app也拷贝至1的文件夹内。 4.将苹果反馈的crashlog文件(.crash)也拷贝至1的文件夹内。 5.使用以下命令: ./symbolicatecrash .crash文件路径 .app/appName 路径 > 名字.crash 可能会报错: Error: "DEVELOPER_DIR" is not defined at ./symbolicatecrash line 69. 执行以下命令即可: export DEVELOPER_DIR=

How PixelsPerInch works in Delphi 10.3 Rio?

£可爱£侵袭症+ 提交于 2021-02-11 16:51:45
问题 I do not understand what is the purpose of PixelsPerInch property... It seems it is useless. If Scaled is checked, PixelsPerInch cannot be modified. If Scaled is unchecked and PixelsPerInch is changed, the form size an font is scaled to a fixed value, regardless of the value you entered in PixelsPerInch field. Of course, I checked the form size at runtime. 回答1: Scaled is True In the dfm file the PixelsPerInch property contains the screen DPI value used when the form was designed. This is

Delphi [PAClient Error] Error: E6660 Could not find program, '/usr/bin/actool' in a macincloud enviroment

旧巷老猫 提交于 2021-02-11 13:37:59
问题 I work with Delphi 10.4 latest version. I have an macInCloud account to compile apps for iOS. I have installed the latest PAServer on the mac machine. (created from scratch). In SDK manager i have syncronized the iPhoneOS12.1 version. Now when I want to deploy an app, the following error appear: [PAClient Error] Error: E6660 Could not find program, '/usr/bin/actool' Any advice? 来源: https://stackoverflow.com/questions/62592641/delphi-paclient-error-error-e6660-could-not-find-program-usr-bin

Delphi Firedac Scripts and Exclamation Mark

。_饼干妹妹 提交于 2021-02-11 13:21:45
问题 I experienced a strange behaviour in Firedac (Delphi 10.3.3) against Firebird 3.04. The following statement insert into icds(id,title) values (55,'!M01.0;M02.6;M03.5'); creates a record in the database like this id title -- ------------- 55 .0;M02.6;M03.5 when run with the fdScript component. If I run the same script with any database IDE, the record is created correctly (same database, same Server). It is defintively related to the exclamation mark because if I replace replace '!' by '?' the

Delphi Firedac Scripts and Exclamation Mark

一曲冷凌霜 提交于 2021-02-11 13:21:15
问题 I experienced a strange behaviour in Firedac (Delphi 10.3.3) against Firebird 3.04. The following statement insert into icds(id,title) values (55,'!M01.0;M02.6;M03.5'); creates a record in the database like this id title -- ------------- 55 .0;M02.6;M03.5 when run with the fdScript component. If I run the same script with any database IDE, the record is created correctly (same database, same Server). It is defintively related to the exclamation mark because if I replace replace '!' by '?' the