-
Content Count
210 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Kryvich
-
When removing say "NO" to "Do you want to remove all Embarcadero RAD Studio 10.3 entries from your registry?"
-
@mijn Same here. But I saved IDE settings before updating using Migration tool. So I still hope to install Delphi 10.3.1 without reinstalling all components. P.S. I uninstalled Delphi 10.3 and installed Delphi 10.3.1. All components are here. Only IDE Fix Pack had to be reinstalled.
-
How to pass an unknown record to a function as argument
Kryvich replied to John Kouraklis's topic in RTL and Delphi Object Pascal
Try overloaded functions function pass(aRec: TMyRecord1): Boolean; overload; function pass(aRec: TMyRecord2): Boolean; overload; ... -
How to obtain the value of a field of type TWndMethod via RTTI?
Kryvich posted a topic in RTL and Delphi Object Pascal
I can do it without RTTI, but get a compiler error when using RTTI: procedure TForm1.Button1Click(Sender: TObject); var ctx: TRttiContext; rt: TRttiType; fld: TRttiField; proc: TWndMethod; begin proc := TabSet1.WindowProc; // Compiles and works OK without RTTI ctx := TRttiContext.Create; try rt := ctx.GetType(TControl); fld := rt.GetField('FWindowProc'); ShowMessage(fld.GetValue(TabSet1).TypeInfo.Name); // 'TWndMethod' if fld.GetValue(TabSet1).IsType<TWndMethod> then // True proc := fld.GetValue(TabSet1).AsType<TWndMethod>; // E2010 Incompatible types: 'procedure, untyped pointer or untyped parameter' and 'TWndMethod' finally ctx.Free; end; end; Any suggestions? -
How to obtain the value of a field of type TWndMethod via RTTI?
Kryvich replied to Kryvich's topic in RTL and Delphi Object Pascal
@Stefan Glienke Just checked your suggestion, brilliantly! proc := fld.GetValue(TabSet1).AsType<TWndMethod>(); No compiler errors. -
@Sue King uData.dfm in binary format opens without error with any version of IDEFixPack installed. But OK... Usually, IDEFixPack is the first plugin I install in a new version of Delphi.
-
@Sue King Try to save your data module in the text format (right click - Text DFM), and then reopen with the previous version of IDEFixPack installed.
-
@jbg I rechecked uData.pas, the error is gone. Thank you for your support of the community!
-
@Sue King Good processor, but it seems it supports SSE4a only too.
-
Of course, I can debug Delphi in Delphi. There is an exception: The debugger stopped here: 0B69F215 F30F6F0A movdqu xmm1,dqword ptr [edx] 0B69F219 660F3817CB ptest xmm1,xmm3 // <--------- here 0B69F21E 0F8582000000 jnz $0b69f2a6 0B69F224 660F6FE1 movdqa xmm4,xmm1
-
@jbg I've tested on AMD Phenom II X4 955. Yes, it seems that this processor supports SSE4a only.
-
That's strange. I disabled all third party design packages, but the error is still here. I just open uData.pas without creating any project. See the video: https://youtu.be/RfB0Lo4ggL4 May be somebody else can test it on his/her computer.
-
Delphi shows "Error creating form: External exception C000001D." when I try to open one of my data modules. When I uninstall the IDE Fix Pack, the error disappears. I deleted all the code from the module, left only one memory table with a data source object, and the error is still here. Please see the files attached. Tested on Delphi Win 32-bit. IDE Fix Pack dev 2019-01-31-1645 for Delphi 10.3. uData.ZIP
-
operator overloding Equal vs Multiply
Kryvich replied to Eugine Savin's topic in RTL and Delphi Object Pascal
@Eugine Savin Is it possible to rewrite your C++ snippet as: MyArray myArr; if (myArr == {0} && myArr == {0, 0}) {} As I understand you need to inline array constants to the Delphi expressions. -
@Mike Torrettinni Check my demo app (attached). Works as needed in Windows 7 (I haven't Win10 here, sorry). Look at the project source: program SplashApp; uses SysUtils, Vcl.Forms, uSplashMain in 'uSplashMain.pas' {Form1}, uSplashForm in 'uSplashForm.pas' {Form5}; {$R *.res} begin Application.Initialize; Form5 := TForm5.Create(nil); try Application.MainFormOnTaskbar := True; Form5.Show; Form5.Update; Application.CreateForm(TForm1, Form1); Sleep(3000); finally Form5.Free; end; Application.Run; end. Form5 is a splash form, and Form1 is a app's main form. Also check menu Project | Options | Application | Forms. The splash Form5 is in the list of available forms (the right list). SplashApp.zip
-
I tried this suggestion for Delphi 7, and it still works in Rio and Windows 7. In TForm5: protected procedure CreateParams(var Params :TCreateParams); override; ... procedure TForm5.CreateParams(var Params: TCreateParams); begin inherited; Params.ExStyle := Params.ExStyle OR WS_EX_APPWINDOW; end;
-
operator overloding Equal vs Multiply
Kryvich replied to Eugine Savin's topic in RTL and Delphi Object Pascal
To tell the compiler the type of operand, I can advise the following: Replace array of Integer with TArray<Integer>. (In 10.3 Rio it is the same type.) Create a helper function: function AsArray(const [ref] Arr: TArray<Integer>): TArray<Integer>; inline; begin Result := Arr; end; ... b := r = AsArray([10]); // It compiles -
If VS is so great, then why RemObjects create Water - their own IDE for Windows?
-
@Alexander Elagin Just in case you need the icons because of change indicators, you can try https://sites.google.com/site/kryvich/kryvichs-editor-status-bars. Works without IDE theming too.
-
Caching with class variables
Kryvich replied to Primož Gabrijelčič's topic in Tips / Blogs / Tutorials / Videos
@Attila Kovacs if typeData.MaxValue > 30 then "change me to UInt64". -
Is it really good practice to create Forms only as needed? Always?
Kryvich replied to Mike Torrettinni's topic in VCL
Have you measured how users work with your program? It's possible that an average user use 5-10 reports (tabs) in one session. Then all controls on other tabs just sit in memory, grab GDI resources without need. It's OK to create the form layouts manually, Delphi has all instruments to make this work easier. But after rising HTML and CSS it has become fashionable to entrust the program with the placement and adjustment of the size of controls on a form. For ex. https://www.delphihtmlcomponents.com/comp.html https://www.delphihtmlcomponents.com/reports.html https://www.devexpress.com/products/vcl/layout/ http://docwiki.embarcadero.com/Libraries/Tokyo/en/FMX.Layouts -
Is it really good practice to create Forms only as needed? Always?
Kryvich replied to Mike Torrettinni's topic in VCL
I presume you didn't put all that controls to the form manually. It's a lot of work. I would use some sort of automation, and create the appropriate controls on the fly when the tab was selected. Then you'll get 3000/50 = 60 controls at a moment. -
Is it really good practice to create Forms only as needed? Always?
Kryvich replied to Mike Torrettinni's topic in VCL
I never see such forms. Is it for flight control center? -
Allocation-Free Collections
Kryvich replied to Erik@Grijjy's topic in Tips / Blogs / Tutorials / Videos
@Stefan Glienke Interesting... Do modern processors can not predict the branch that will be executed in the common case? -
Is it really good practice to create Forms only as needed? Always?
Kryvich replied to Mike Torrettinni's topic in VCL
You're right. A better solution would be to create and initialize a form by request, and then Show(ShowModal)/Close it as needed. The reference to the created form can be saved as a class variable and freed when an application to finish. It makes sense for forms that need to maintain their state. Or for modal dialogs. And you need to ensure that two or more identical forms are not opened at the same time.