Jump to content

Микола Петрівський

  • Content Count

  • Joined

  • Last visited

Everything posted by Микола Петрівський

  1. Микола Петрівський

    [out] and [in] in records

    In modern Delphi you can do that like this: TMyRecord = record private FSrcPosition: TPoint; function GetDestination: TPoint; public property SrcPosition: TPoint write FSrcPosition; property DstPosition: TPoint read GetDestination; end;
  2. Микола Петрівський

    serious bug with Indy based code and I9 8/16 cores

    Standalone web servers is not a common type of projects for Delphi. That is why default memory manager was not tweaked for such load. But full version of FastMM4 has lots of different tweaks specifically for multi-threading, so you can customize it as you wish.
  3. Микола Петрівський

    New project with embedded browser

    If you only need to display HTML written by yourself, then THtmlViewer might be an option.
  4. Микола Петрівський

    Conceptual - callbacks that are called from background thread

    Your TСompressor.Create runs in current thread, so you can easily store it as CallerThread. Then, in decompression thread, you can synchronize to CallerThread instead of main GUI thread.
  5. Микола Петрівський

    handling predicate conditions

    It is almost the same as Assert(value <> nil, 'Value is nil!'); Assert(str <> '', 'String is empty!'); Assert(Value.Num > 0, 'Value.Number <= 0!');
  6. Микола Петрівський

    looking for design ideas for an easily editable list

    This is, probably, the simplest possible solution, if you limit yourself to "out of the box" solutions. By the way, TClientDataSet can be replaced with TFDMemTable.
  7. Микола Петрівський

    Generic Command Line Parser for Delphi 10.3.x

    I was expecting to see at least built in support for "--help" and "--version". As it is now, it is not much different to FindCmdLineSwitch.
  8. Микола Петрівський

    WinAPI to query if a form is ready to Rock.

    We had similar problem, except, that we wanted to know, when app finishes processing any long task, and is ready to accept new input. And we wasn't allowed to change the code of the app. Our first attempt was to use SetWindowsHookEx in WH_FOREGROUNDIDLE mode. That was working in most cases, but sometimes we had situations, when the last message in the message queue is actually the one, that causes processing of long task, so our hook was triggering at the beginning of the processing, not the end. Also, this hook will hang until some message will get in to message queue, so some sort of wake up message is required. Finally we decided, that since target app uses runtime packages, we can call VCL for help. Now our test app is using windows hooks only to inject our code (dll compiled with runtime packages) in to target process. Then we create event handler for Application.OnIdle. This approach is much more reliable, something like 95%. If you can change the code of target app, then it will the best approach. P.S. You could avoid all of that, if VCL supported UI Automation
  9. Микола Петрівський

    Lots of errors when trying to compile an old project

    Try to toggle compiler cache on and off: http://docwiki.embarcadero.com/RADStudio/Rio/en/Compiling_and_Running
  10. Микола Петрівський

    Refer to Form Control without using the Form unit?

    You of course know, that you can break some cycles by moving parts of uses to implementation section, right?
  11. Микола Петрівський

    Delphi 10.3 Update 2 available

    Try to install Xcode on your Mac. I think, reading the log will be much easier: http://docwiki.embarcadero.com/RADStudio/Rio/en/New_features_and_customer_reported_issues_fixed_in_RAD_Studio_10.3.2
  12. Микола Петрівський

    Delphi 10.3 Update 2 available

    Looks like I can download fresh ISO from torrent, but I need hash sum to be sure, that it is correct file. Can someone post your sum here? MD5 will be enough.
  13. Микола Петрівський

    ANN: StyleControls VCL with Fluent UI background support just released!

    What API are you using? As far, as I know, Acrylic Blur is not documented for classic Win32 apps. And using undocumented API is not a good idea.
  14. Микола Петрівський

    LiveBinding at runtime

    You will need to manually call TBindings.Notify because your controls are not observable: http://docwiki.embarcadero.com/RADStudio/Rio/en/Tutorial:_Creating_LiveBindings-Enabled_Components As to why even manual call does not work, it is hard to tell without compilable demo.
  15. Микола Петрівський

    LiveBinding at runtime

    Maybe, you should try Bind(srcViewModel.Container,'DataSource',dstDBGrid,'DataSource') ? But in general, this looks suspicious to me. Usually LiveBindings are used to replace data-aware controls, and you are trying to mix them. What do you want to achieve?
  16. Микола Петрівський

    Passing back a string from an external program

    Just create global atom and pass it's code to the caller. Or caller can create empty atom, and then check for changes.
  17. Микола Петрівський

    Android ADB devices offline, best practices

    ADB over USB has never worked for me in VirtualBox VMs. That is why I always use ADB over WiFi: https://developer.android.com/studio/command-line/adb#wireless
  18. Микола Петрівський

    MacOS development environment

    If you are going to develop GUI apps for Mac, then you really need dedicated hardware with separate screen, keyboard and mouse. But if you already have good Windows PC, then the best option will be to by some cheap Mac Mini.
  19. Микола Петрівський

    DPI-change, crashes tDrawgrid.

    Do not forget, that any app nowadays has multiple threads, and when you break the program, currently selected thread does not necessarily will be VCL main thread. You need to select correct thread in Threads window.
  20. Микола Петрівський

    FastMM4 large memory allocation–benchmarking VirtualAlloc

    In my tests 64-bit app is ten times faster, then 32-bit on real hardware. In VM difference is only two times, but 32-bit code is twice faster, then on host. Very interesting results.
  21. Микола Петрівський

    On-demand ARC feature discussed

    Interesting observation: Android ART is written in C++ and core of Unity (game engine) is also written in C++. In both cases code with manual memory management is doing all hard work, and garbage collected code (Java and C#) sits on top of it. So authors of this codebases also were perfectly aware of problems related to mixing different memory management models, and have separated them on language borders. Delphi has to be good in both low level stuff and business logic, so it had to switch to simpler memory management model.
  22. Микола Петрівський

    On-demand ARC feature discussed

    Your code contains memory leak. After a call to "Modify", pointer to original object, inside "classic" variable, will be lost.
  23. Микола Петрівський

    Delphi compiler need to be opensourced

    No matter what you do, sooner or later RTL will have to insert a call to UniqueString. For example when you pass your variable to a function with var parameter. For strings this is not a problem, because they are value types, their copying does not have side effects. For objects you can't guarantee, that copying is safe. You can ask programmers to mark their objects as copy safe, and add additional compiler restrictions for unsafe objects. But how many times some object will happen to have wrong mark, and how easy it will be to debug and fix it?
  24. Микола Петрівський

    GetIt Package Manager Item buttons only partially visible

    If Embarcadero had been testing IDE for HiDPI, then they would spot the problems in IDE manifest first of all. But manifest remains broken for several releases already. So they clearly do not test for HiDPI. And in the docs you will not find any statements, that IDE is HiDPI-aware.
  25. Микола Петрівський

    When is a Delphi form actually visible to the user on Android?

    As far, as I know, TBitmap had problems with threads in Tokyo. In Rio it should be fine.