Jump to content

Der schöne Günther

Members
  • Content Count

    468
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Der schöne Günther

  1. Der schöne Günther

    The best way to handle undo and redo.

    The Command Design Pattern (sourcemaking.com) is generally used for undo/redo operations. Regarding databases: Not sure if you're looking for undo/redo or just transactions. Maybe this is relevant to you: Managing Transactions (FireDAC) - RAD Studio (embarcadero.com)
  2. Der schöne Günther

    Converting a very long text to concatenated strings?

    This is exactly what the MultiPaste tool is for. You can find it in Delphi at Edit -> MultiPaste. Using the MultiPaste Tool - RAD Studio (embarcadero.com) (I think the picture they posted is incorrect, as it is not realated to MultiPaste at all)
  3. Der schöne Günther

    How do I update the sqlite dll in RAD Studio?

    I am running "Delphi 11 and C++ Builder 11 Update 1" which is, I believe, the most current version. However, the integrated Sqlite library the IDE makes use of (FireDAC), is considerably older. I'd like to update it, as the query editor doesn't even understand some of our queries anymore. Double-clicking on a TFDConnection, then navigating to Info reveals the following: ================================ Client info ================================ Loading driver sQLite ... DLL = <sqlite3_x86.obj statically linked> Client version = 3.31.1 I found a sqlite3.dll in C:\Program Files (x86)\Embarcadero\Studio\22.0\bin and replaced it with the most current version, downloaded from the SQLite Download Page. However, that changed nothing. I have no idea how to proceed. I find dozens of guides how to manage the dll your own application will pick at runtime. But I am looking for the IDE, bds.exe. How to update sqlite?
  4. Der schöne Günther

    How do I update the sqlite dll in RAD Studio?

    I would have considered going to quality.embarcadero.com - But it's been down again since yesterday 😉
  5. Der schöne Günther

    How do I update the sqlite dll in RAD Studio?

    Yes, fancy things like these were exactly why I updated 😊 🎉 It already works fine in my application by setting the driver link settings to "dynamic" (as you mentioned). I just wish the IDE would also be capable of that. Instead of being tied to an outdated version of sqlite that is baked into it. There really is no reason to do that, it's a very strange design decision.
  6. Der schöne Günther

    How do I update the sqlite dll in RAD Studio?

    Thank you for the swift reply, that's what I feared. I have no clue why they did it that way. Every freeware tool I know has the sqlite.dll in a separate library, so that it can be updated later, even when the tool itself is no longer supported.
  7. Yes, __fastcall has zero effect on x64 and ARM, compilers will usually just ignore it. It seems ctors/dtors are a special case when it comes to calling conventions. See [RSP-30762] [bcc32c]: fastcall calling convention ignored on constructor/destructor - Embarcadero Technologies [RSP-23671] Unexpected compiler error - Embarcadero Technologies [RSP-33071] [bcc32c error] virtual function '~XXX' has different calling convention attributes ('void ()') than the function it overrides (which has calling convention 'void () __attribute__((fastcall))') : overridden virtual function is here - Embarcadero Technologies From what I gathered, Embarcadero maintained their own patch queue of modifications for clang so that calling conventions were handled also for constructors/destructors but appearantly, they are struggling to keep up with clang development.
  8. Der schöne Günther

    Changing TToolButton image and using transparency

    That is not a good idea, even with something like 32 × 32 pixels. You should always have an alpha layer, where pixels are neither entirely black or "not there", but something in between. So that it doesn't matter which background they're on: Here it is getting more obvious: In our VCL applications, we're using png files. Theyre small, lossless and support alpha channel. If you can, you could even consider vector graphics like SVG. That way, you won't even have to worry about supplying different resolutions for different displays.
  9. Der schöne Günther

    Printer events : Corresponding Hook

    Not sure about hooks, but it looks the spooler API has what you need DocumentEvent function (Winspool.h) - Win32 apps | Microsoft Docs FindFirstPrinterChangeNotification function (Winspool.h) - Win32 apps | Microsoft Docs
  10. Der schöne Günther

    Ugly exception handling bug in 11.1.5

    I stopped using C++ Builder because of the truly abysmal exception handling with Clang. The leaks were the least of my concern. According to [RSP-13173] C++ compiler exception handling is completely broken - Embarcadero Technologies, it should have been fixed, and they even had a blog post how it should have been improved with 10.4.2: (Source) Sad to see it's still not properly fixed. They have been having the LLVM backend for C++ for what now... ten years?
  11. Der schöne Günther

    Format source with tabs

    I am not familiar with the GExperts formatter, never used it before. Is it true that it is hard-wired to always use spaces for indentation? I only found an option to set "Spaces per Indent". Many thanks in advance.
  12. Der schöne Günther

    Do I need to free list

    If a TObjectList<T> has OwnsObjects = True, it will free the contained objects when the list itself is freed. If no one ever frees the list, it will stay in memory, and all its contained objects. You say you produce a new list. If no one else keeps a reference to the old list anymore, it should be freed. Even better, in my opinion, would be not creating new lists all the time, but that you change your helper object so that you pass your already existing list, and it will add the new object to that list, instead of creating its own. This way, you don't have to deal with creating and freeing lists, you just have one single list of the entire lifetime of your outer object.
  13. Der schöne Günther

    auto close or logout when no mouse activity

    We also use GetLastInputInfo() for exactly that (revoking any special permissions on a kiosk system if there has been no input for a few minutes). It's been working fine since we added it in 2016. Keep in mind that the tick count returned by GetLastInputInfo() is just a DWORD - Meaning it will roll over after 49.7 days. Our users were not happy when they were immediately logged out again after the system had been running for more than 50 days 😐
  14. Der schöne Günther

    how to read included code

    Have you checked and run the example programs in the Samples subdirectory? For example, in Samples/Component Demo, it is a complete application with a EidReader component on the form. This component has several events like OnCardInserted. My suggestion is you just try out the samples, they seem simple enough.
  15. Oh, in that case, absolutely. Guess I should watch it.
  16. What did I miss? What I understand is that It is not part of the language, it is just a regular method from the standard library Earlier versions did have an untyped parameter and let you pass in things that were not descendants of TObject If that is all, how can you even have an opinion on that? What is there to talk about? Can somebody get me up to date with just one or two sentences? Many thanks.
  17. Der schöne Günther

    Left side cannot be assigned to

    That they cannot be passed as var or out was more a comparison to simple fields, I should have made that clearer. Meaning: If you don't need getter/setters, I fail to see why you would ever go with properties at all.
  18. Der schöne Günther

    Left side cannot be assigned to

    In my absolutely personal opinion, never bother with properties at all. There is no real use for them. They have a lot of other disadvantages - You can't pass them as var or out parameters, Code completion will not tell you if a property is writeable or not. Many other languages are perfectly fine with no properties at all. I can think of C# properties, but they are capable of so much more. In Delphi, a getter/setter makes it immediately clear if a value can be read or written, makes it obvious that there could be side effects as it's not just a regular variable, and can be stored in a function pointer. Also, you can make the setter protected and only allow yourself and your subclasses or another interface to change the value. None of this is possible with properties. In my opinion, they just get in the way and require even more typing as Delphi is already incredibly verbose.
  19. Der schöne Günther

    Left side cannot be assigned to

    Your variable FBoundsRect is of type TRectF which is a record. Records are passed by value, not by reference. Meaning: When you access TempResult.BoundsRect, you are not acting on the original data, but a copy on it. Yes, in theory, you can access and modify the temporary data, but the compiler does not let you as it makes no sense to do so. The compiler message is unfortunately, once again, not helpful. One solution is storing it in a temporary local variable, and then assigning it back, after you have changed the bounds rect. Another one is getting rid of the the properties altogether as they just add noise and hide the fact that you can just replace the complete record, but not just parts of it, as you desire. program Project1; uses System.SysUtils, System.Types; type TMyObject = class(TObject) strict private var _PropField: TRectF; public property PropField: TRectF read _PropField write _PropField; public var VarField: TRectF; end; var myObject: TMyObject; begin myObject := TMyObject.Create(); myObject.VarField.Left := 12.0; myObject.PropField.Left := 12.0; // E2064 LEft side cannot be assigned to end.
  20. Der schöne Günther

    RDP and RD Web deployment of Delphi VCL apps

    Somehow reminds me of this... Source: xkcd: Troubleshooting Sorry for not being helpful. Sometimes, it really is a mess. Even the IDE itself sometimes manages to display modal windows behind itself and the only thing left for me to do is entirely kill it and start fresh.
  21. Der schöne Günther

    Trouble getting JSON FindValue (JSONPath) to work

    Not that I know. Here is another example System.JSON.Builders.TJSONIterator.Find - RAD Studio API Documentation (embarcadero.com) Maybe I just forgot $., was glad it worked, and then moved on. 🙃
  22. Der schöne Günther

    Trouble getting JSON FindValue (JSONPath) to work

    Take at the look at the documentation again, it has some examples. Get Rid of the $ and the dot. program Project1; uses System.SysUtils, System.JSON; begin var myjson:=TJSONObject.ParseJSONValue('{"name": "Chris","value": 10000}'); var myval:=myjson.FindValue('name'); Assert(myVal.Value() = 'Chris'); end. Or here, with arrays: program Project1; uses System.SysUtils, System.JSON; const json = '{'+ ' "name": "Chris",'+ ' "pets": ['+ ' {'+ ' "name": "Rufus",'+ ' "type": "dog",'+ ' "age": 10'+ ' },'+ ' {'+ ' "name": "Wraabargl",'+ ' "type": "Dinosaur",'+ ' "age": 113'+ ' }'+ ' ]'+ '}'; begin var myjson:=TJSONObject.ParseJSONValue(json); var myval:=myjson.FindValue('pets[1].type'); Assert(myVal.Value() = 'Dinosaur'); readln; end.
  23. Der schöne Günther

    Delphi 11.1 - High DPI

    Without more context, it's impossible to say what is wrong in your case. I was very pleasantly surprised when I updated on of our XE7 applications to 10.4 in order to support High DPI. It took me a few days, but everything seemed logical (I had to make a few small changes where the UI used a hard coded number of pixels) - And in the end, it turned out to be great.
  24. Der schöne Günther

    Newly released book: Delphi Legacy Projects

    Same here. I can hardly see myself buying a textbook on paper ever again. Also, don't forget syncing your position. I really like to read something on my computer, or Kindle, and half a day later, I can continue reading on my phone, exactly where I left off.
  25. Der schöne Günther

    sqlmemtable

    Its homepage has a lot of encoding errors (at least in my language), I don't remember when I last saw pictures of CD ROMs on web pages and the text advertises it to be compatible with Delphi 7 and Delphi 2006. Go figure. Delphi comes with FireDAC memory tables that support SQL. Local SQL (FireDAC) - RAD Studio (embarcadero.com) Delphi 10.2: Using Local SQL with Firedac Memory Tables - Stack Overflow
×