Jump to content

A.M. Hoornweg

Members
  • Content Count

    38
  • Joined

  • Last visited

Community Reputation

19 Good

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. A.M. Hoornweg

    Best site/source for SQL Server questions?

    Is it a two-tier (multiple clients/one server) or three-tier system (with some middleware or website between the clients and the server)? In the first case, consider using a CTE (it runs atomically). In the latter case, consider using a mutex.
  2. A.M. Hoornweg

    THTTPReqResp.OnBeforePost breaking change

    ... anxiously awaiting 10.3.2 ....
  3. Hello all, I'm trying to port an older (Delphi XE) SOAP client application to Delphi Rio. I'm stumbling upon a breaking change in THTTPReqResp, which is used by tHTTPRio. The signature of the event THTTPReqResp.OnBeforePost has changed completely. Formerly the signature was: TBeforePostEvent = procedure (CONST HTTPReqResp: THTTPReqResp; Data: Pointer); My routine does some manipulation of the http headers, for example it calls wininet.HTTPAddRequestHeaders(Data, ...) to allow gzip encoding and wininet.InternetSetOption(Data,....) to accept an invalid/self-signed SSL certificate. The new signature of the event has become: TBeforePostEvent = procedure(const HTTPReqResp: THTTPReqResp; Client: THTTPClient) of object; and now I'm stumped. How can I achieve the same as before? I want to accept gzip encoded data and I want to accept self signed SSL certificates. Kind regards, Arthur
  4. I use form inheritance all the time. I have a base class that implements DPI Awareness on older Delphi versions (pre-XE10). From this, I inherited a new form class that handles multi-language (using dxGettext). And from this, I inherit a few form classes defining a consistent look-and-feel, like using my favorite font (Tahoma) and a top-aligned panel with our company logo.
  5. A.M. Hoornweg

    DPI-change, crashes tDrawgrid.

    Hi Dmitry, as far as I can see, the patch works!
  6. A.M. Hoornweg

    DPI-change, crashes tDrawgrid.

    Unfortunately tCustomgrid has no methods beginupdate / endupdate.
  7. A.M. Hoornweg

    DPI-change, crashes tDrawgrid.

    Done, https://quality.embarcadero.com/browse/RSP-24430
  8. A.M. Hoornweg

    DPI-change, crashes tDrawgrid.

    I have found the core of the issue. When a form receives a wm_dpichanged message, TCustomForm.WMDpiChanged is called which scales all components on the form. But TCustomGrid does it in a terrible way; there's this simple loop that modifies the heights of the rows: [vcl.grids, TCustomGrid.ChangeScale(), line 1735] for I := 0 to RowCount -1 do RowHeights := MulDiv(RowHeights, M, D); and in the debugger I see that this loop needs a whopping 72 seconds to complete on my Core i7 notebook (for 86400 rows). The reason? It appears that the changing of a single row height triggers an InvalidateGrid() plus an update of the scroll bars (which, incidentally, is why my breakpoints kept landing in USER32.SetScrollInfo). And all of this happens inside the handling of a wm_dpichanged message, so the message queue is blocked for ages which freezes my desktop.
  9. A.M. Hoornweg

    DPI-change, crashes tDrawgrid.

    When the freeze happens, all windows on the desktop (including the Delphi IDE) become unresponsive to mouse clicks and keyboard events. I need to press ctrl-alt-del to get into the task manager, only then am I able to set a breakpoint in the Delphi IDE. I managed to break into the main thread of the program and set a breakpoint there. The breakpoint itself is in GDI32.InternalDeleteDC() and the base of the call stack is in USER32.SetScrollInfo. Continuing the program then triggers the same breakpoint in an endless loop. If I simply remove the tDrawGrid from the form then the problem disappears and I can move the form between displays with different DPI without any freezing. If I set the grid's rowcount to a very low number, there is no problem either. My workaround for now is to temporarily set the rowcount to 1 just before the dpi change.
  10. A.M. Hoornweg

    DPI-change, crashes tDrawgrid.

    In the debugger I can break the program, but the current IP is always somewhere inside a Windows DLL and the call stack has no entries. I tried to make a reproducible test app, but no luck.
  11. A.M. Hoornweg

    DPI-change, crashes tDrawgrid.

    Hello all, In a certain application of mine that contains a tDrawGrid, the program hangs if I drag the form between two screens with different resolutions. The program becomes totally unresponsive and I need to kill it with the task manager. This crash only happens if the grid contains a large number of rows and columns. It is compiled with Delphi Rio 10.3.1. I can work around it by setting the rowcount to a very small number immediately before the DPI change and then restore it afterwards. Kind regards, Arthur
  12. A.M. Hoornweg

    Blast from the past: BDE and Win10 W/S

    OK, so you guys use network mappings for just about everything. I know for a fact that in our own network some mappings often "hickup" and get disconnected for fractions of a second. This might be related to windows group policies being enforced in the background as suggested in this post https://social.technet.microsoft.com/Forums/en-US/5d9c7f34-5cf3-453a-a40a-3225e7995e9c/network-drive-keeps-loosing-connectivity?forum=win10itpronetworking but I don't know if the solution suggested in that thread actually works or not. As a workaround, would it be possible for you to ditch the "T:" mapping and instead use UNC names (\\server\sharename)?
  13. A.M. Hoornweg

    Constructors + Destructors in class helpers?

    Class helpers are merely a bunch of procedures and functions grouped together that mimic methods of a class. Each method has an invisible first parameter that passes the object and treats it as if it were "self". So literally nothing gets constructed or destructed, they're merely procedures/functions that act on an object. The advantage of class helpers is that one can extend a class, without actually inheriting from it, and that everything is neatly wrapped inside the namespace of that class. As an analogy, it's a bit like having an optional side car attached to a motor cycle, instead of permanently changing the vehicle itself. The major disadvantage of class helpers is that there can only be one helper "in scope" for your code (so the sequence of units in your "uses" clause suddenly becomes important). (Edit) but of course a class helper can have a method that returns a new instance of the class (or of any other class), but that's not really a constructor. It would be a factory method.
  14. You're right, that's what it's called nowadays (and it is a much clearer description). Any idea in what OS version Microsoft renamed it?
  15. I rarely ever use repeat either. Because a repeat loop always iterates at least once. The example of the original poster will throw a GPF if the initial node is the root node. I do use exit() , but if it is inside a try/finally block, I always write a remark behind it that it will jump to the next "finally" statement.
×