Jump to content


Popular Content

Showing content with the highest reputation on 03/17/23 in all areas

  1. The problem is - the more complex a question, the more complex an answer. As long as ChatGPT is mostly right, most of the time - it is high risk that an answer can be a little wrong or a lot wrong. I will not waste time on solutions that might be partially correct or completely wrong, nor will I spend time on researching the problems other people have with shit they got from ChatGPT. When it gets better, we can discuss it again, but I suspect it would be better use of ML to find flaws or room for improvements in our own code. There is learning in the struggle to understand a new topic. Ready made and wrong answers from an "inventive" "AI" are not good for learning.
  2. Fr0sT.Brutal

    Protected TCP/IP Client/Server connection

    You're able to modify clients? If yes, use TLS and check certificates of both server (at client side) and client (at server side), ensure certificate corresponds to server host and, for the maximum security, add auth by login-password
  3. david berneda

    Creating FMX controls in a background thread

    I recently did a TeeChart fix to avoid creating its Windows Handle when just drawing it to a image without showing on screen. https://www.steema.com/bugs/show_bug.cgi?id=667 We posted a beta yesterday available for download, let me know if your colleague is interested in testing I'll provide a license. regards ! david
  4. Dalija Prasnikar

    VCL and VCL styles - bugs and future

    To avoid flooding another thread with unrelated posts about VCL quality and bugs, I have opened this topic for discussion about VCL in general and VCL Styles. First, I would like to respond to comment made by @Attila Kovacs VCL is not abandoned, not even close. Maybe it is not receiving too many new features as people would hope so, but it has more to do with its maturity than anything else. FMX (is) was in frenzy development cycle, only because it didn't have the needed features VCL already had, and it still does not have all. So it may have seemed that FMX is getting all the love and attention, but that was not the case. Many new Windows related features introduced since FMX has come to play, are still VCL only. Keep in mind that IDE is based on VCL, and I don't see that changing in foreseeable future. VCL is evolving and it will continue to evolve. It is not that FMX is new better, improved framework mean to replace VCL for all purposes, it is framework with completely different architecture and it covers different use cases. While some functionality certainly overlaps, and there are (Windows only) applications where both VCL and FMX can be chosen, there are also applications where VCL is far better (and sometimes, even only viable) choice. VCL Styles are buggy, they have been buggy since they were introduced in XE2. But, they are now part of the IDE. That means two things. First, IDE is now suffering from some bugs, but it also means that those bugs will get fixed sooner rather than later. Unfortunately, not all bugs can be solved overnight, and the more specific, reproducible bug reports there are, the higher are chances that those bugs will get a fix. If you have any filed VCL bug reports you might want to share, please do so.
  5. timfrost

    Syntax Highlighting

    PlusMemo is an enhanced memo component for Delphi and CBuilder, with comprehensive syntax highlighting features. I have been a satisfied user for 20 years and have recommended it here in the past. Powerful, fast, and simple to specify keywords and syntax elements, with samples for some common file types such as HTML, and with various editor-related utilities included. And of course the good set of user editing features that you would expect in a high-quality editor. I just discovered that it has recently become 'free with source', with packages for from D2009 to Alexandria. Definitely worth a look, at ecmqc.com/plusmemo/pmHome.htm, if you need any type of syntax highlighting editor in your applications.
  6. Remy Lebeau

    Protected TCP/IP Client/Server connection

    That is exactly what TLS is meant for. It handles ALL of that stuff for you. Clients can validate that they are connected to the official server and not another server (especially a man-in-the-middle). And the server can validate that only trusted clients are connecting to it. And ALL communication is encrypted back and forth.
  7. lmbelo

    Delphi 11.2 - Ubuntu Debugger error

    The LLDB seems to require a Python distribution compiled with the "--enable-shared" flag. The regular APT Python distribution doesn't use the dynamically linked interpreter. However, Installing python3.x-dev and libpython3.x-dev should be enough for this case. Make sure to install the same versions.
  8. Fr0sT.Brutal

    Creating FMX controls in a background thread

    Thanks! I talked to my colleague and he told that that project is working OK, he managed to get things done. But now he's aware of your fix and will decide if he needs it I see. Child sends message to parent and parent occasionally sends message to child. Oops!
  9. @Rollo62 if the project is from old-IDE, did you try delete all files created by IDE, like *.dproj, and *.res etc... and building under RAD11.3? sometimes I do the (crazy) tests, like: backup a folder or files, when all is out-control, you see, and.... delete all files (in project) created by IDE c:\users\...\"Embarcadero" <-- and delete all, and run my IDE again etc... new fresh files!!! sometimes works, sometimes not! but dont worry, I has my "restore-files"
  10. Angus Robertson

    Segmentation Fault in IcsMbToWc

    LocaleCharsFromUnicode was available in XE2 so is now used from that version. A lot of conditional code has now gone. Angus
  11. shineworld

    Protected TCP/IP Client/Server connection

    I will try to learn how to add TLS in TIdTCPServer and TIdTCPClient 🙂
  12. I have also observed the behavior with me. Just choose your layout again
  13. Sir Alex

    Segmentation Fault in IcsMbToWc

    Ok, found a way to solve problem. In fact, System module already have crossplatform versions of functions WideCharToMultibyte and MultiByteToWideChar. So functions IcsWcToMb and IcsMbToWc can be easily replaced within: {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} function IcsWcToMb(CodePage: LongWord; Flags: Cardinal; WStr: PWideChar; WStrLen: Integer; MbStr: PAnsiChar; MbStrLen: Integer; DefaultChar: PAnsiChar; UsedDefaultChar: PLongBool): Integer; begin Result := LocaleCharsFromUnicode(CodePage, Flags, WStr, WStrLen, MbStr, MbStrLen, DefaultChar, PLongBool(UsedDefaultChar)); end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} function IcsMbToWc(CodePage: LongWord; Flags: Cardinal; MbStr: PAnsiChar; MbStrLen: Integer; WStr: PWideChar; WStrLen: Integer): Integer; begin Result := UnicodeFromLocaleChars(CodePage, Flags, MbStr, MbStrLen, WStr, WStrLen); end; P.S. Now, MIME decoder works fine
  14. Dalija Prasnikar

    Creating FMX controls in a background thread

    Yes, you can have control that completely runs in the different thread that runs its own message loop. That is different scenario from the one I said - constructing the controls in background thread and then using them in main thread. Using (inside main thread) and merely communicating (sending messages are different things. There are boundaries between controls that belong to different threads. In other words there are different levels of thread-safety. Since Windows API has thread affinity, it is not fully thread-safe. In practical terms having such application means that you need to deal with more complexities in places where you otherwise wouldn't, Using UI in same thread means you can use SendMessage to perform operations quickly because in the context of same thread SendMessage will avoid the message queue and will simply run the windows proc. However, when you SendMessage to window that belongs to different thread, SendMessage will go through message queue. But, SendMessage is blocking call and in complex to-way communication between two threads with SendMessage you can easily cause deadlock. OK, solution to that is that you don't use SendMessage, but only non blocking communication, which is slower. and that would probably work if you handle all those windows manually directly through Windows API and you exactly know to which thread they belong to. Assing any abstraction layer on top your be a nightmare (this is where we start stepping into Delphi RTL and visual frameworks). Again, thread affinity is what makes it thread-unsafe. Now, you may have different viewpoint on what thread-safe is in this context, but not being completely thread-unsafe is still far from being completely thread-safe. Some additional reading: https://devblogs.microsoft.com/oldnewthing/20051010-09/?p=33843 https://devblogs.microsoft.com/oldnewthing/20051011-10/?p=33823 https://devblogs.microsoft.com/oldnewthing/20051012-00/?p=33803 https://devblogs.microsoft.com/oldnewthing/20051013-11/?p=33783
  15. Dalija Prasnikar

    Creating FMX controls in a background thread

    There is way more in UI thread safety than thread safe communication between controls. In Windows API windows can communicate across thread-boundaries, but each window still belongs and is bound to a thread where it is created and that thread's message queue. This basically prevents you to create window control in one thread (background) and use it in another (main).
  16. Fr0sT.Brutal

    String literals more then 255 chars

    I usually keep long texts in resources as RCDATA but extending the limits would be nice...
  17. Because there isn't (at least not in the RTL) - ChatGPT is making that up (as so often).