<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:re="http://purl.org/atompub/rank/1.0">
    <title type="text">Newest questions tagged delphi - Stack Overflow</title>
    <link rel="self" href="https://stackoverflow.com/feeds/tag?tagnames=delphi&amp;sort=newest" type="application/atom+xml" />
    <link rel="alternate" href="https://stackoverflow.com/questions/tagged?tagnames=delphi&amp;sort=newest" type="text/html" />
    <subtitle>most recent 30 from stackoverflow.com</subtitle>
    <updated>2026-07-31T13:45:23Z</updated>
    <id>https://stackoverflow.com/feeds/tag?tagnames=delphi&amp;sort=newest</id>
    <creativeCommons:license>https://creativecommons.org/licenses/by-sa/4.0/rdf</creativeCommons:license> 
    <entry>
        <id>https://stackoverflow.com/q/79989220</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">Can&#xB4;t debug Delphi exception in RAD Studio</title>
            <category scheme="https://stackoverflow.com/tags" term="debugging" />
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="rad-studio" />
        <author>
            <name>sausagerus</name>
            <uri>https://stackoverflow.com/users/4392195</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79989220/can%c2%b4t-debug-delphi-exception-in-rad-studio" />
        <published>2026-07-30T14:31:59Z</published>
        <updated>2026-07-30T14:59:44Z</updated>
        <summary type="html">
            &lt;p&gt;I have some strange behavior of my IDE or Project.&lt;/p&gt;&#xA;&lt;p&gt;Two projects, same code.&lt;/p&gt;&#xA;&lt;p&gt;For example: to reproduce an exception, I declare stringlist and try to add string into it without creating a list.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;procedure TForm1.Button1Click(Sender: TObject);&#xA;var&#xA;  sl: TStringList;&#xA;begin&#xA;  try&#xA;    sl.Add(&#x27;bla&#x27;);&#xA;  except&#xA;    on E: Exception do&#xA;    begin&#xA;      Memo1.Lines.Add(&#x27;)))&#x27;);&#xA;      raise Exception.Createfmt(&#x27;Fehlermeldung&#x27;, [&#x27;&#x27;]);&#xA;    end;&#xA;  end;&#xA;end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I place a debug breakpoint on&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Memo1.Lines.Add(&#x27;)))&#x27;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Project one: I click button, get only one notification from my IDE &amp;quot;access violation&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.sstatic.net/16Irrt3L.png&quot; alt=&quot;enter image description here&quot; title=&quot;Notification1&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;I click forward and it goes on to the debug point.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.sstatic.net/lGW7iK39.png&quot; alt=&quot;enter image description here&quot; title=&quot;debug project 1&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Project two: I do the same steps like in project one and it jumping over exception block. I click button, get notification from my IDE, click forward on notification and now I get infinity notifications over Debugger -Exception &amp;quot;EIntOverflow&amp;quot;... &amp;quot;Integeroverflow&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.sstatic.net/jtHLIq4F.png&quot; alt=&quot;enter image description here&quot; title=&quot;2.nd notification project 2&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;But only in debug mode, if I start the .exe, it works.&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79985939</id>
        <re:rank scheme="https://stackoverflow.com">1</re:rank>
        <title type="text">IDispatch::Invoke crashes server-side COM framework for basic IAccessible implementation for child count 1&#x2B; for IAccessible::get_accChildCount</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="com" />
            <category scheme="https://stackoverflow.com/tags" term="idispatch" />
            <category scheme="https://stackoverflow.com/tags" term="iaccessible" />
        <author>
            <name>Blaiz Enterprises</name>
            <uri>https://stackoverflow.com/users/32681734</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79985939/idispatchinvoke-crashes-server-side-com-framework-for-basic-iaccessible-implem" />
        <published>2026-07-25T23:42:14Z</published>
        <updated>2026-07-29T18:35:04Z</updated>
        <summary type="html">
            &lt;p&gt;I&#x27;m trying to implement basic accessibility support for a custom GUI (server-side) - all GUI controls are custom/non-MS - via &lt;code&gt;IAccessible&lt;/code&gt;. However, my COM framework keeps crashing. &#xA0;Even pure skeletal definitions crash.&lt;/p&gt;&#xA;&lt;p&gt;The crash appears to be centered around &lt;code&gt;IDispatch::Invoke()&lt;/code&gt;. Whenever &lt;code&gt;IAccessible::get_accChildCount()&lt;/code&gt; is called and returns 1 or more for the child count, &lt;code&gt;IDispatch::Invoke()&lt;/code&gt; is called thereafter and crashes the app. &#xA0;Even a bare &amp;quot;non-implemented&amp;quot; version of &lt;code&gt;IDispatch&lt;/code&gt; crashes at &lt;code&gt;Invoke()&lt;/code&gt;. &#xA0;The value for &lt;code&gt;iid&lt;/code&gt; for &lt;code&gt;Invoke()&lt;/code&gt; is also not &lt;code&gt;IID_NULL&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I&#x27;m using &amp;quot;Accessibility Insights for Windows&amp;quot; and &amp;quot;Visual UIA Verify&amp;quot; as client apps to probe my app/test the COM framework.&lt;/p&gt;&#xA;&lt;p&gt;I code in Borland Delphi 3 Professional (32-bit) using Object Pascal, and wish to implement the COM framework as pure binary vTables and standard COM functions using &lt;code&gt;stdcall&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;OleVariant&lt;/code&gt; seems unstable in Delphi 3. I have swapped it out for &lt;code&gt;tcomvar&lt;/code&gt; (16 bytes for 32-bit and 24 bytes for 64-bit). &#xA0;I have tried various different function parameter definitions, higher-level object/interface definitions, even imported &lt;code&gt;IAccessible&lt;/code&gt; using the &amp;quot;Import Type Library&amp;quot; function in Delphi 3, but all to no success. &#xA0;I even tried the COM framework in Borland Delphi 7 with no change, it still crashes.&lt;/p&gt;&#xA;&lt;p&gt;I am new to COM, but understand the basic design principal governing its function.&lt;/p&gt;&#xA;&lt;p&gt;However, everything I have tried to date has failed to fix the &lt;code&gt;IDispatch::Invoke()&lt;/code&gt; error. &#xA0;I suspect it is something simple I have overlooked. &#xA0;But trying to get precise, accurate, and detailed information at this low level in Object Pascal from the Internet has been a real challenge.&lt;/p&gt;&#xA;&lt;p&gt;I have tried Copilot and Google&#x27;s AI extensively over days. Both are helpful, but lack the technical background and accuracy to get right down to the nitty gritty detail where it counts.&lt;/p&gt;&#xA;&lt;p&gt;I could simply deny the request for the &lt;code&gt;IID_IDispatch&lt;/code&gt; interface in &lt;code&gt;QueryInterface()&lt;/code&gt;, but I suspect it is required for proper/broad client app support, e.g. scripting engines etc, and also, I&#x27;d like to understand what the error actually is, and what I have done wrong, so I can fix it.&lt;/p&gt;&#xA;&lt;p&gt;I&#x27;ve included a stripped down demo version of the COM framework hooked to a standard &lt;code&gt;TForm&lt;/code&gt; for the &lt;code&gt;WM_GETOBJ&lt;/code&gt; message for testing purposes only.&lt;/p&gt;&#xA;&lt;p&gt;Any help is much appreciated.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;unit com1;&#xA;&#xA;interface&#xA;&#xA;uses&#xA;  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, com2,&#xA;  ExtCtrls, StdCtrls;&#xA;&#xA;type&#xA;  TForm1 = class(TForm)&#xA;  private&#xA;    procedure wmgetobj(var Message: TMessage); message wm_getobject;&#xA;  public&#xA;&#xA;  end;&#xA;&#xA;var&#xA;  Form1: TForm1;&#xA;&#xA;implementation&#xA;&#xA;{$R *.DFM}&#xA;&#xA;procedure TForm1.wmgetobj(var Message: TMessage);&#xA;var&#xA;  m                  :twinmessage;&#xA;begin&#xA;  if not form1.showing then exit;&#xA;&#xA;  m.r                   :=0;&#xA;  m.l                   :=message.lparam;&#xA;  m.w                   :=message.wparam;&#xA;  m.m                   :=message.msg;&#xA;&#xA;  if auto__wmgetobject(nil,m) then message.result:=m.r;&#xA;end;&#xA;&#xA;end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;unit com2;&#xA;&#xA;interface&#xA;&#xA;{$ifdef WIN64}{$define 64bit}{$endif}&#xA;&#xA;uses sysutils;&#xA;&#xA;const&#xA;  VT_EMPTY                     =0;&#xA;  VT_NULL                      =1;&#xA;  VT_I4                        =3;&#xA;  VT_DISPATCH                  =9;&#xA;  VT_BYREF                     =$4000;&#xA;  min32                        =-2147483647-1;&#xA;  max32                        = 2147483647;&#xA;  maxcore                      =999;//gui&#xA;  WM_GETOBJECT                 =61;&#xA;  OBJID_WINDOW                 =0;&#xA;  OBJID_CLIENT                 =-4;&#xA;  S_OK                         =$00000000;&#xA;  S_FALSE                      =$00000001;&#xA;  E_FAIL                       =$80004005;//10apr2026&#xA;  E_NOINTERFACE                =$80004002;&#xA;  E_INVALIDARG                 =$80070057;&#xA;  E_NOTIMPL                    =$80004001;//17jul2026&#xA;  DISP_E_BADINDEX              =$8002000B;&#xA;  DISP_E_MEMBERNOTFOUND        =$80020003;&#xA;  DISP_E_UNKNOWNNAME           =$80020006;&#xA;  DISP_E_UNKNOWNINTERFACE      =-2147352575;&#xA;  iid_null                     :tguid=&#x27;{00000000-0000-0000-0000-000000000000}&#x27;;&#xA;  iid_unknown                  :tguid=&#x27;{00000000-0000-0000-C000-000000000046}&#x27;;//IUnknown&#xA;  iid_dispatch                 :tguid=&#x27;{00020404-0000-0000-C000-000000000046}&#x27;;//automation/scripting interface (VB,office, etc)&#xA;  iid_accessible               :tguid=&#x27;{618736E0-3C3D-11CF-810C-00AA00389B71}&#x27;;//IAccessible&#xA;  ROLE_SYSTEM_APPLICATION      =14;&#xA;  ROLE_SYSTEM_OUTLINE          =35;&#xA;  ROLE_SYSTEM_PUSHBUTTON       =43;&#xA;  DISPATCH_METHOD              =1;&#xA;  DISPATCH_PROPERTYGET         =2;&#xA;  DISPATCH_PROPERTYPUT         =4;&#xA;  DISPATCH_PROPERTYPUTREF      =8;&#xA;&#xA;type&#xA;  longint32                    =longint;&#xA;  longint64                    =comp;&#xA;  {$ifdef 64bit}&#xA;  iauto                        =longint64;&#xA;  hauto                        =longint64;&#xA;  {$else}&#xA;  iauto                        =longint32;&#xA;  hauto                        =longint32;&#xA;  {$endif}&#xA;  pauto                        =pointer;&#xA;  bstr                         =pauto;&#xA;  uint32                       =longint32;//32 bit only&#xA;  pwinmessage                  =^twinmessage;&#xA;  twinmessage                  =record//09jan2025&#xA;&#xA;    m                           :iauto;&#xA;    w                           :iauto;&#xA;    l                           :iauto;&#xA;    r                           :iauto;&#xA;&#xA;  end;&#xA;&#xA;  pint64                       =^tint64;&#xA;  tint64                       =packed record&#xA;    case longint of&#xA;&#xA;      0:(val:longint64);&#xA;      1:(cmp:comp);&#xA;      2:(cur:currency);&#xA;      3:(dbl:double);&#xA;      4:(bytes:array[0..7] of byte);&#xA;      5:(wrds:array[0..3] of word);&#xA;      6:(ints:array[0..1] of longint);&#xA;      7:(bits:set of 0..63);&#xA;      8:(datetime:tdatetime);&#xA;&#xA;  end;&#xA;&#xA;  pcomvar                      =^tcomvar;&#xA;  tcomvar                      =packed record&#xA;&#xA;    vt                          :word;&#xA;    wreserved1                  :word;&#xA;    wreserved2                  :word;&#xA;    wreserved3                  :word;//8 bytes&#xA;&#xA;    case longint32 of&#xA;      vt_i4                       :(i32:longint32);&#xA;      vt_dispatch                 :(dispatch:pauto);&#xA;&#xA;      vt_byref or vt_i4           :(pi32:^longint32);&#xA;      vt_byref or vt_dispatch     :(pdispatch:^pauto);&#xA;&#xA;      max32                       :(a:pauto;b:pauto);//8 bytes (32-bit) or 16 bytes (64-bit)&#xA;&#xA;  end;&#xA;&#xA;  tbasiccontrol                =tobject;//sample GUI control&#xA;&#xA;  pautoslot                    =^tautoslot;&#xA;  tautoslot                    =record&#xA;&#xA;    vtable                      :pauto;&#xA;    flist                       :array[0..28] of pauto;&#xA;    cok                         :boolean;&#xA;    c                           :tbasiccontrol;&#xA;    slot                        :longint32;&#xA;&#xA;  end;&#xA;&#xA;  pautoinfo                    =^tautoinfo;&#xA;  tautoinfo                    =record&#xA;&#xA;    timer1000                   :longint64;&#xA;    active                      :boolean;&#xA;    lasttime                    :longint64;&#xA;    slotCount                   :longint32;//number of COM slots in use&#xA;    mcount                      :longint32;//message count -&amp;gt; &amp;quot;wmgetobject&amp;quot; requests&#xA;    qcount                      :longint32;//call count for &amp;quot;queryInterface&amp;quot;&#xA;    ucount                      :longint32;//call count for IUnknown&#xA;    dcount                      :longint32;//call count for IDispatch&#xA;    acount                      :longint32;//call count for IAccessible&#xA;    temp                        :longint32;&#xA;&#xA;  end;&#xA;&#xA;var&#xA;  auto_list                    :array[-1..maxcore] of tautoslot;//18jul2026&#xA;  auto_info                    :tautoinfo;&#xA;&#xA;//automation procs&#xA;procedure auto__init;&#xA;function  auto__connect(const xcontrol:tbasiccontrol):longint32;&#xA;procedure auto__connectBySlot(const xcontrol:tbasiccontrol;const xslot:longint32);&#xA;procedure auto__disconnect(const xcontrol:tbasiccontrol;var xcontrolSlot:longint32);&#xA;function  auto__root(const xslot:longint32):pautoslot;&#xA;function auto__wmgetobject(const g:tobject;var m:twinmessage):boolean;&#xA;&#xA;//support procs&#xA;function rollid32(var x:longint32):longint32;&#xA;function com__guidMatch(const s,d:tguid):boolean;&#xA;function com__makebstr(const x:string):pauto;&#xA;function bolstr(const x:boolean):string;&#xA;function low__cls(const x:pointer;const xsize:longint32):boolean;&#xA;procedure showbasic(const x:string);&#xA;function win____MessageBox(hWnd:hauto; lpText, lpCaption: PChar; uType: uint32): longint32; stdcall; external &#x27;user32.dll&#x27; name &#x27;MessageBoxA&#x27;;&#xA;function win____LresultFromObject(const refiid:TGUID;wparam:iauto;punk:IUnknown):iauto;stdcall; external &#x27;oleacc.dll&#x27; name &#x27;LresultFromObject&#x27;;&#xA;function win____DefWindowProc(hWnd: hauto; Msg: iauto; wParam: iauto; lParam: iauto): iauto; stdcall; external &#x27;user32.dll&#x27; name &#x27;DefWindowProcA&#x27;;&#xA;function win____CoInitializeEx(pvReserved: pauto; coInit: Longint): hauto; stdcall; external &#x27;ole32.dll&#x27; name &#x27;CoInitializeEx&#x27;;&#xA;function win____CoInitialize(pvReserved: pauto): hauto; stdcall; external &#x27;ole32.dll&#x27; name &#x27;CoInitialize&#x27;;&#xA;function win____SysAllocString(x:pauto):pauto; stdcall; external &#x27;oleaut32.dll&#x27; name &#x27;SysAllocString&#x27;;&#xA;&#xA;//comvar procs&#xA;function comvar__ok(var x:tcomvar):boolean;&#xA;function comvar__vt(var x:tcomvar):longint32;&#xA;function comvar__i32OK(var x:tcomvar):boolean;&#xA;function comvar__i32(var x:tcomvar):longint32;&#xA;function comvar__i32b(var x:tcomvar;const xdefVal:longint32):longint32;&#xA;function comvar__dispatchOK(var x:tcomvar):boolean;&#xA;function comvar__dispatch(var x:tcomvar):pauto;&#xA;procedure comvar__init(var x:tcomvar);&#xA;procedure comvar__setnull(var x:tcomvar);&#xA;procedure comvar__setempty(var x:tcomvar);&#xA;procedure comvar__seti32(var x:tcomvar;const v:longint32);&#xA;procedure comvar__setDispatch(var x:tcomvar;const v:pauto);&#xA;&#xA;implementation&#xA;&#xA;uses forms, com1;&#xA;&#xA;//automation procs&#xA;function auto__iunknown__addref(self:pauto):longint32;stdcall;&#xA;begin&#xA;  result             :=2;&#xA;end;&#xA;&#xA;function auto__iunknown__queryinterface(self:pauto;const iid:tguid;out obj):longint32;stdcall;&#xA;begin&#xA;  rollid32( auto_info.ucount );&#xA;&#xA;  if com__guidMatch( iid ,iid_unknown    ) or&#xA;     com__guidMatch( iid ,iid_dispatch   ) or&#xA;     com__guidMatch( iid ,iid_accessible ) then&#xA;&#xA;  begin&#xA;    rollid32( auto_info.qcount );&#xA;&#xA;    result             :=s_ok;&#xA;    pauto(obj)         :=self;&#xA;  end&#xA;&#xA;  else begin&#xA;    result             :=e_nointerface;&#xA;    pauto(obj)         :=nil;&#xA;  end;&#xA;&#xA;end;&#xA;&#xA;function auto__iunknown__release(self:pauto):longint32;stdcall;&#xA;begin&#xA;  result                :=1;&#xA;end;&#xA;&#xA;function auto__idispatch__GetTypeInfoCount(self:pauto;out count:longint32):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.dcount);&#xA;  result                :=E_NOTIMPL;&#xA;  count:=0;&#xA;end;&#xA;&#xA;function auto__idispatch__GetTypeInfo(self:pauto;index,localeid:longint32;out typeinfo):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.dcount);&#xA;  result                :=E_NOTIMPL;&#xA;  pauto(typeinfo):=nil;&#xA;end;&#xA;&#xA;function auto__idispatch__GetIDsOfNames(self:pauto;const IID:TGUID;names:pauto;nameCount,localeid:longint32;dispids:pauto):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.dcount);&#xA;  result                :=E_NOTIMPL;&#xA;end;&#xA;&#xA;function auto__idispatch__Invoke(self:pauto;xdispid:longint32;const iid:tguid;localeid:longint32;flags:word;var Params;varresult:pcomvar; excepinfo,argerr:pauto ):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.dcount);&#xA;  result                :=E_NOTIMPL;&#xA;&#xA;  //note: inbound &amp;quot;iid&amp;quot; should be &amp;quot;iid_null&amp;quot; but it&#x27;s not&#xA;  if com__guidMatch(iid,iid_null) then&#xA;  begin&#xA;    //triggers a crash when &amp;quot;const&amp;quot; is removed from above function definition&#xA;  end;&#xA;&#xA;  if (varresult&amp;lt;&amp;gt;nil) then&#xA;  begin&#xA;    varresult^.vt:=vt_null;//triggers a crash&#xA;  end;&#xA;&#xA;  excepinfo   :=nil;&#xA;  argerr      :=nil;&#xA;end;&#xA;&#xA;function auto__get_accParent(self:pauto;out ppdispParent:IDispatch):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result      :=s_ok;&#xA;&#xA;  if (self=@auto_list[0]) then ppdispParent:=nil&#xA;  else                         ppdispParent:=idispatch( @auto_list[0] );&#xA;&#xA;end;&#xA;&#xA;function auto__get_accChildCount(self:pauto;out pcountChildren:longint32):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;&#xA;  //simulate root control (auto_list[0]) with 10 children&#xA;  if (self=@auto_list[0]) then&#xA;  begin&#xA;    result                :=s_ok;&#xA;    pcountChildren        :=10;//triggers call to idispatch::invoke which crashes app&#xA;    end&#xA;  else begin&#xA;    result                :=E_NOTIMPL;&#xA;    pcountChildren        :=0;&#xA;  end;&#xA;end;&#xA;&#xA;function auto__get_accChild(self:pauto;vChild:tcomvar;out ppdispChild:IDispatch):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;&#xA;  case comvar__i32(vchild) of&#xA;    1..max32:begin&#xA;      result                :=s_ok;&#xA;      ppdispChild           :=idispatch( @auto_list[1] );&#xA;    end;&#xA;&#xA;  else begin&#xA;      result                :=E_NOTIMPL;&#xA;      ppdispChild           :=nil;&#xA;    end;&#xA;  end;//case&#xA;&#xA;end;&#xA;&#xA;function auto__get_accName(self:pauto;vChild:tcomvar;out pszName:bstr):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=s_ok;&#xA;  pszName               :=com__makebstr(&#x27;control.name.&#x27;&#x2B;inttostr(comvar__i32b(vchild,-999)));//25jul2026&#xA;end;&#xA;&#xA;function auto__get_accValue(self:pauto;vChild:tcomvar;out pszValue:bstr):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;  pszvalue              :=nil;&#xA;end;&#xA;&#xA;function auto__get_accDescription(self:pauto;vChild:tcomvar;out pszDescription:bstr):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;  pszDescription        :=nil;&#xA;end;&#xA;&#xA;function auto__get_accRole(self:pauto;vChild:tcomvar;pvarRole:pcomvar):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=E_INVALIDARG;&#xA;&#xA;  if (pvarRole&amp;lt;&amp;gt;nil) then&#xA;  begin&#xA;    result             :=s_ok;&#xA;    comvar__seti32(pvarRole^,ROLE_SYSTEM_PUSHBUTTON);&#xA;  end;&#xA;&#xA;end;&#xA;&#xA;function auto__get_accState(self:pauto;vChild:tcomvar;out pvarState:pcomvar):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;//E_INVALIDARG;&#xA;  if (pvarState&amp;lt;&amp;gt;nil) then comvar__setempty(pvarState^);&#xA;end;&#xA;&#xA;function auto__get_accHelp(self:pauto;vChild:tcomvar;out pszHelp:bstr):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;  pszHelp               :=nil;&#xA;end;&#xA;&#xA;function auto__get_accHelpTopic(self:pauto;out pszHelpFile:bstr;vChild:tcomvar;out pidTopic:longint32):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;  pszHelpFile           :=nil;&#xA;  pidTopic              :=0;&#xA;end;&#xA;&#xA;function auto__get_accKeyboardShortcut(self:pauto;vChild:tcomvar;out pszShortcut:bstr):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;  pszShortcut           :=com__makebstr(&#x27;Ctrl&#x2B;F&#x27;);//dummy value&#xA;  result                :=s_ok;&#xA;end;&#xA;&#xA;function auto__get_accFocus(out pvarChild:pcomvar): longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;&#xA;  if (pvarChild&amp;lt;&amp;gt;nil) then&#xA;  begin&#xA;    result             :=s_ok;&#xA;    comvar__seti32(pvarChild^,3);//return child 3 as focused&#xA;  end;&#xA;&#xA;end;&#xA;&#xA;function auto__get_accSelection(self:pauto;out pvarChildren:pcomvar):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;end;&#xA;&#xA;function auto__get_accDefaultAction(self:pauto;vChild:tcomvar;out pszDefaultAction:bstr):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=s_false;&#xA;  pszDefaultAction      :=nil;&#xA;end;&#xA;&#xA;function auto__accSelect(self:pauto;flagsSelect:longint32;varChild:tcomvar):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=s_false;//or DISP_E_MEMBERNOTFOUND;&#xA;end;&#xA;&#xA;function auto__accLocation(self:pauto;out pxLeft,pyTop,pcxWidth,pcyHeight:longint32;out varChild:pcomvar):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;  pxLeft                :=0;&#xA;  pyTop                 :=0;&#xA;  pcxWidth              :=0;&#xA;  pcyHeight             :=0;&#xA;end;&#xA;&#xA;function auto__accNavigate(self:pauto;navDir:longint32;varStart:tcomvar;out pvarEndUpAt:pcomvar):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=s_false;//or DISP_E_MEMBERNOTFOUND;&#xA;end;&#xA;&#xA;function auto__accHitTest(self:pauto;xLeft,yTop:longint32;out pvarChild:pcomvar):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=s_false;//or DISP_E_MEMBERNOTFOUND;&#xA;end;&#xA;&#xA;function auto__accDoDefaultAction(self:pauto;varChild:tcomvar):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;end;&#xA;&#xA;function auto__put_accName(self:pauto;varChild:tcomvar;const pszName:widestring):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=E_NOTIMPL;//discontinued&#xA;end;&#xA;&#xA;function auto__put_accValue(self:pauto;vChild:tcomvar;const pszName:widestring):longint32;stdcall;&#xA;begin&#xA;  rollid32(auto_info.acount);&#xA;  result                :=DISP_E_MEMBERNOTFOUND;&#xA;end;&#xA;&#xA;//gui level procs&#xA;procedure auto__init;&#xA;var&#xA;  p                  :longint32;&#xA;&#xA;begin&#xA;&#xA;  //init -------------------------------------------------------------------------&#xA;&#xA;  ismultithread:=true;&#xA;  win____CoInitialize(nil);&#xA;&#xA;  low__cls( @auto_info ,sizeof(auto_info) );&#xA;  low__cls( @auto_list ,sizeof(auto_list) );&#xA;&#xA;  auto__connectBySlot( nil ,-1 );//emergency fallback slot&#xA;&#xA;  //make dummy controls&#xA;  for p:=0 to 99 do auto__connect( tbasiccontrol.create );&#xA;&#xA;end;&#xA;&#xA;function auto__connect(const xcontrol:tbasiccontrol):longint32;&#xA;var&#xA;  p                  :longint32;&#xA;&#xA;begin&#xA;&#xA;  //defaults&#xA;  result                :=-1;&#xA;&#xA;  //check&#xA;  if (xcontrol=nil) then exit;&#xA;&#xA;  //find existing&#xA;  for p:=0 to high(auto_list) do&#xA;  begin&#xA;&#xA;    if auto_list[p].cok and (auto_list[p].c=xcontrol) then&#xA;    begin&#xA;&#xA;      result             :=p;&#xA;      exit;&#xA;&#xA;    end;&#xA;&#xA;  end;//p&#xA;&#xA;  //find new&#xA;  for p:=0 to high(auto_list) do&#xA;  begin&#xA;&#xA;    if not auto_list[p].cok then&#xA;    begin&#xA;      result             :=p;&#xA;      break;&#xA;    end;&#xA;&#xA;  end;//p&#xA;&#xA;  //at capacity&#xA;  if (result=-1) then exit;&#xA;&#xA;  //connect&#xA;  auto__connectBySlot( xcontrol ,result );&#xA;&#xA;end;&#xA;&#xA;procedure auto__connectBySlot(const xcontrol:tbasiccontrol;const xslot:longint32);&#xA;var&#xA;  findex                       :longint32;&#xA;&#xA;  procedure fadd(const f:pauto);&#xA;  begin&#xA;&#xA;    if ( findex &amp;lt;= high(auto_list[0].flist) ) then&#xA;    begin&#xA;&#xA;      if (f&amp;lt;&amp;gt;nil) then&#xA;      begin&#xA;&#xA;        auto_list[xslot].flist[ findex ] :=f;&#xA;&#xA;        inc( findex );&#xA;&#xA;      end;&#xA;&#xA;    end&#xA;&#xA;    else begin&#xA;&#xA;      showbasic(&#x27;Warning: COM function exceeds capacity for tautoslot&#x27;);&#xA;&#xA;    end;&#xA;&#xA;  end;&#xA;&#xA;begin&#xA;&#xA;  //check&#xA;  if (xslot&amp;lt;low(auto_list)) or (xslot&amp;gt;high(auto_list)) then exit;&#xA;&#xA;&#xA;  //set root vars ----------------------------------------------------------------&#xA;&#xA;  auto_list[xslot].c              :=xcontrol;&#xA;  auto_list[xslot].cok            :=(xcontrol&amp;lt;&amp;gt;nil);&#xA;  auto_list[xslot].slot           :=xslot;//25jul2025&#xA;&#xA;  //add COM interfaces -----------------------------------------------------------&#xA;&#xA;  //.unknown&#xA;  with auto_list[xslot] do&#xA;  begin&#xA;&#xA;    vtable                          :=@flist[0];&#xA;    flist[0]                        :=@auto__iunknown__queryinterface;&#xA;    flist[1]                        :=@auto__iunknown__addref;&#xA;    flist[2]                        :=@auto__iunknown__release;&#xA;    findex                          :=3;&#xA;&#xA;  end;&#xA;&#xA;  //.dispatch&#xA;  fadd( @auto__idispatch__GetTypeInfoCount    );&#xA;  fadd( @auto__idispatch__GetTypeInfo         );&#xA;  fadd( @auto__idispatch__GetIDsOfNames       );&#xA;  fadd( @auto__idispatch__Invoke              );&#xA;&#xA;  //.accessible&#xA;  fadd( @auto__get_accParent                  );&#xA;  fadd( @auto__get_accChildCount              );&#xA;  fadd( @auto__get_accChild                   );&#xA;  fadd( @auto__get_accName                    );&#xA;  fadd( @auto__get_accValue                   );&#xA;  fadd( @auto__get_accDescription             );&#xA;  fadd( @auto__get_accRole                    );&#xA;  fadd( @auto__get_accState                   );&#xA;  fadd( @auto__get_accHelp                    );&#xA;  fadd( @auto__get_accHelpTopic               );&#xA;  fadd( @auto__get_accKeyboardShortcut        );&#xA;  fadd( @auto__get_accFocus                   );&#xA;  fadd( @auto__get_accSelection               );&#xA;  fadd( @auto__get_accDefaultAction           );&#xA;  fadd( @auto__accSelect                      );&#xA;  fadd( @auto__accLocation                    );&#xA;  fadd( @auto__accNavigate                    );&#xA;  fadd( @auto__accHitTest                     );&#xA;  fadd( @auto__accDoDefaultAction             );&#xA;  fadd( @auto__put_accName                    );&#xA;  fadd( @auto__put_accValue                   );&#xA;&#xA;end;&#xA;&#xA;procedure auto__disconnect(const xcontrol:tbasiccontrol;var xcontrolSlot:longint32);&#xA;var&#xA;  p                  :longint32;&#xA;&#xA;begin&#xA;&#xA;  //check&#xA;  if (xcontrol=nil) then exit;&#xA;&#xA;  //fast&#xA;  if (xcontrolSlot&amp;gt;=0) and (xcontrolSlot&amp;lt;=high(auto_list)) and (auto_list[xcontrolSlot].cok) and (auto_list[xcontrolSlot].c=xcontrol) then&#xA;  begin&#xA;&#xA;    auto_list[xcontrolSlot].cok  :=false;&#xA;    auto_list[xcontrolSlot].c    :=nil;&#xA;    xcontrolSlot                 :=-1;&#xA;    exit;&#xA;&#xA;  end;&#xA;&#xA;  //slow&#xA;  for p:=0 to high(auto_list) do&#xA;  begin&#xA;&#xA;    if auto_list[p].cok and (auto_list[p].c=xcontrol) then&#xA;    begin&#xA;&#xA;      auto_list[p].cok   :=false;&#xA;      auto_list[p].c     :=nil;&#xA;      xcontrolSlot       :=-1;&#xA;      exit;&#xA;&#xA;    end;&#xA;&#xA;  end;&#xA;&#xA;  //fallback&#xA;  xcontrolSlot          :=-1;&#xA;&#xA;end;&#xA;&#xA;function auto__root(const xslot:longint32):pautoslot;&#xA;begin&#xA;  if (xslot&amp;gt;=0) and (xslot&amp;lt;=high(auto_list)) and auto_list[xslot].cok then result:=@auto_list[xslot]&#xA;  else                                                                     result:=@auto_list[-1];//fallback&#xA;end;&#xA;&#xA;function auto__wmgetobject(const g:tobject;var m:twinmessage):boolean;&#xA;begin&#xA;&#xA;  //defaults&#xA;  result      :=false;&#xA;&#xA;  //iaccessible&#xA;  if (m.l=OBJID_Window) then&#xA;  begin&#xA;    rollid32( auto_info.mcount );&#xA;    result   :=true;&#xA;    m.r      :=win____LresultFromObject( iid_accessible ,m.w ,iunknown( @auto_list[0] ) );&#xA;  end&#xA;&#xA;  else if (longint32(m.l)=OBJID_CLIENT) then&#xA;  begin&#xA;    rollid32( auto_info.mcount );&#xA;    result   :=true;&#xA;    m.r      :=win____LresultFromObject( iid_accessible ,m.w ,iunknown( @auto_list[0] ) );&#xA;  end;&#xA;&#xA;end;&#xA;&#xA;&#xA;//support procs&#xA;function rollid32(var x:longint32):longint32;//1..max32, never &amp;lt;=0&#xA;begin&#xA;  if      (x&amp;lt;=0)    then x:=1&#xA;  else if (x&amp;lt;max32) then x:=x&#x2B;1&#xA;  else                   x:=1;&#xA;&#xA;  result:=x;&#xA;end;&#xA;&#xA;function com__guidMatch(const s,d:tguid):boolean;//18jul2026&#xA;begin&#xA;  result      :=&#xA;                ( s.d1    = d.d1    ) and&#xA;                ( s.d2    = d.d2    ) and&#xA;                ( s.d3    = d.d3    ) and&#xA;                ( s.d4[0] = d.d4[0] ) and&#xA;                ( s.d4[1] = d.d4[1] ) and&#xA;                ( s.d4[2] = d.d4[2] ) and&#xA;                ( s.d4[3] = d.d4[3] ) and&#xA;                ( s.d4[4] = d.d4[4] ) and&#xA;                ( s.d4[5] = d.d4[5] ) and&#xA;                ( s.d4[6] = d.d4[6] ) and&#xA;                ( s.d4[7] = d.d4[7] );&#xA;end;&#xA;&#xA;function com__makebstr(const x:string):pauto;//COM basic string&#xA;var&#xA;  a        :widestring;&#xA;begin&#xA;  a           :=x;&#xA;  result      :=win____sysallocstring( pwidestring(a) );&#xA;end;&#xA;&#xA;function bolstr(const x:boolean):string;&#xA;begin&#xA;  if x then result:=&#x27;1&#x27; else result:=&#x27;0&#x27;;&#xA;end;&#xA;&#xA;function low__cls(const x:pointer;const xsize:longint32):boolean;&#xA;begin&#xA;  result:=(x&amp;lt;&amp;gt;nil);&#xA;  if result then fillchar(x^,xsize,0);&#xA;end;&#xA;&#xA;procedure showbasic(const x:string);&#xA;begin&#xA;  win____MessageBox( 0 ,pchar(x) ,&#x27;Information&#x27; ,$00000000&#x2B;$40 );&#xA;end;&#xA;&#xA;function comvar__ok(var x:tcomvar):boolean;&#xA;begin&#xA;&#xA;  case x.vt of&#xA;    vt_empty                     :result:=true;&#xA;    vt_null                      :result:=true;&#xA;    vt_i4                        :result:=true;&#xA;    vt_i4 or vt_byref            :result:=true;&#xA;    vt_dispatch                  :result:=true;&#xA;    vt_dispatch or vt_byref      :result:=true;&#xA;  else                            result:=false;&#xA;  end;//case&#xA;&#xA;end;&#xA;&#xA;function comvar__vt(var x:tcomvar):longint32;&#xA;begin&#xA;  result                       :=x.vt;&#xA;end;&#xA;&#xA;function comvar__i32OK(var x:tcomvar):boolean;&#xA;begin&#xA;  case x.vt of&#xA;    vt_i4                        :result:=true;&#xA;    vt_i4 or vt_byref            :result:=true;&#xA;  else                            result:=false;&#xA;  end;//case&#xA;end;&#xA;&#xA;function comvar__i32(var x:tcomvar):longint32;&#xA;begin&#xA;  case x.vt of&#xA;    vt_i4                        :result:=x.i32;&#xA;    vt_i4 or vt_byref            :result:=x.pi32^;&#xA;  else                            result:=0;&#xA;  end;//case&#xA;end;&#xA;&#xA;function comvar__i32b(var x:tcomvar;const xdefVal:longint32):longint32;&#xA;begin&#xA;  case x.vt of&#xA;    vt_i4                        :result:=x.i32;&#xA;    vt_i4 or vt_byref            :result:=x.pi32^;&#xA;  else                            result:=xdefVal;&#xA;  end;//case&#xA;end;&#xA;&#xA;function comvar__dispatchOK(var x:tcomvar):boolean;&#xA;begin&#xA;  case x.vt of&#xA;    vt_dispatch                  :result:=true;&#xA;    vt_dispatch or vt_byref      :result:=true;&#xA;  else                            result:=false;&#xA;  end;//case&#xA;end;&#xA;&#xA;function comvar__dispatch(var x:tcomvar):pauto;&#xA;begin&#xA;  case x.vt of&#xA;    vt_dispatch                  :result:=x.dispatch;&#xA;    vt_dispatch or vt_byref      :result:=x.pdispatch^;&#xA;  else                            result:=nil;&#xA;  end;//case&#xA;end;&#xA;&#xA;procedure comvar__init(var x:tcomvar);&#xA;begin&#xA;  low__cls(@x,sizeof(x));&#xA;end;&#xA;&#xA;procedure comvar__setnull(var x:tcomvar);&#xA;begin&#xA;  x.vt                         :=vt_null;&#xA;end;&#xA;&#xA;procedure comvar__setempty(var x:tcomvar);&#xA;begin&#xA;  x.vt                         :=vt_empty;&#xA;end;&#xA;&#xA;procedure comvar__seti32(var x:tcomvar;const v:longint32);&#xA;begin&#xA;  x.vt                         :=vt_i4;&#xA;  x.i32                        :=v;&#xA;end;&#xA;&#xA;procedure comvar__setDispatch(var x:tcomvar;const v:pauto);&#xA;begin&#xA;  x.vt                         :=vt_dispatch;&#xA;  x.dispatch                   :=v;&#xA;end;&#xA;&#xA;initialization&#xA;  auto__init;&#xA;&#xA;end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79972126</id>
        <re:rank scheme="https://stackoverflow.com">2</re:rank>
        <title type="text">Delphi 13 , compile error using old source code with DUNITX</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="dunit" />
        <author>
            <name>Franz</name>
            <uri>https://stackoverflow.com/users/1362082</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79972126/delphi-13-compile-error-using-old-source-code-with-dunitx" />
        <published>2026-07-01T11:52:31Z</published>
        <updated>2026-07-07T10:21:23Z</updated>
        <summary type="html">
            &lt;p&gt;I have moved my  code over many Delphi versions - without any change  on the  code base .&lt;/p&gt;&#xA;&lt;p&gt;The upgrade from Delphi 10.4 to Delphi 13 for my dunitx testcases failed :&lt;/p&gt;&#xA;&lt;p&gt;Working code Delphi 10.4&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;assert.AreEqual(aList.Count, 3, &#x27;Items count OK ?&#x27;);&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;New Working code Delphi 13.1&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;assert.AreEqual&amp;lt;Integer&amp;gt;(aList.Count,Integer(3), &#x27;Items count OK ?&#x27;);&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Did the  Delphi compiler  become worse ?   .....  because the compiler cannot automatically determine the type parameter for the generic any longer ??&lt;/p&gt;&#xA;&lt;p&gt;Has my previous old solution been wrong ?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79970406</id>
        <re:rank scheme="https://stackoverflow.com">-2</re:rank>
        <title type="text">Only final project in Project Group (bpg) runs correctly</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="delphi-7" />
        <author>
            <name>AlainD</name>
            <uri>https://stackoverflow.com/users/2377399</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79970406/only-final-project-in-project-group-bpg-runs-correctly" />
        <published>2026-06-29T15:55:09Z</published>
        <updated>2026-07-21T23:39:28Z</updated>
        <summary type="html">
            &lt;p&gt;My Delphi project group (.bpg) has three projects:&lt;/p&gt;&#xA;&lt;p&gt;PROJECTS = Proj1.exe Proj2.exe Proj3.exe&lt;/p&gt;&#xA;&lt;p&gt;When loaded in the IDE, I can switch between (activate) projects. All projects build correctly and can be debugged. The EXEs can also be launched from outside the IDE.&lt;/p&gt;&#xA;&lt;p&gt;The problem is the &#x27;Run Without Debugging&#x27; option in the IDE. Only the final project (Proj3) is able to use &#x27;Run Without Debugging&#x27;... all the others produce an error:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;System Error. Code 2.The system cannot find the file specified.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I have tried the following:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Changed the order of projects in the .bpg. The result is the same: &lt;em&gt;only&lt;/em&gt; the final project can use &#x27;Run Without Debugging&#x27; - the others produce error code 2. Regardless of the order, all projects build correctly and can be debugged.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Closed the project group and loaded each project separately in their own IDE. The result is that all work correctly: build, can be debugged, and can use &#x27;Run Without Debugging&#x27;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Is this the only way around this problem?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79968964</id>
        <re:rank scheme="https://stackoverflow.com">1</re:rank>
        <title type="text">Delphi IDE issue &quot;no code formatting possible&quot;</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="delphi-ide" />
            <category scheme="https://stackoverflow.com/tags" term="delphi-13-florence" />
        <author>
            <name>Franz</name>
            <uri>https://stackoverflow.com/users/1362082</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79968964/delphi-ide-issue-no-code-formatting-possible" />
        <published>2026-06-28T14:17:24Z</published>
        <updated>2026-07-01T16:11:04Z</updated>
        <summary type="html">
            &lt;p&gt;I have a strange issue with a recent installation of Delphi 13: The functions &amp;quot;&lt;em&gt;Format Source&lt;/em&gt;&amp;quot;  and &amp;quot;&lt;em&gt;Refactor&lt;/em&gt;&amp;quot; are disabled.  What happened to my installation? Where can I fix this issue?&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.sstatic.net/JXv6GQ2C.png&quot; alt=&quot;context menu with disabled entries&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Screen dump: &amp;quot;&lt;em&gt;Format Source Ctrl&#x2B;D&lt;/em&gt;&amp;quot; is disabled in the context menu.&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79965901</id>
        <re:rank scheme="https://stackoverflow.com">6</re:rank>
        <title type="text">Possible Delphi Win64 Debugger Bug: Volatile registers (RCX/RDX) truncated to 32-bit after breakpoints under heavy multithreaded load</title>
            <category scheme="https://stackoverflow.com/tags" term="windows" />
            <category scheme="https://stackoverflow.com/tags" term="debugging" />
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="assembly" />
            <category scheme="https://stackoverflow.com/tags" term="x86-64" />
        <author>
            <name>Zolt&#xE1;n B&#xED;r&#xF3;</name>
            <uri>https://stackoverflow.com/users/8097334</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79965901/possible-delphi-win64-debugger-bug-volatile-registers-rcx-rdx-truncated-to-32" />
        <published>2026-06-23T13:52:22Z</published>
        <updated>2026-06-24T21:34:56Z</updated>
        <summary type="html">
            &lt;p&gt;I am developing a high-performance PS/PDF RIP workflow engine in Delphi (Win64 target). The rendering engine relies heavily on multithreading and custom assembly blocks (AVX/YMM instructions for RLE processing).&lt;/p&gt;&#xA;&lt;p&gt;I recently encountered a severe &#x201C;Heisenbug&#x201D;: the application runs flawlessly in Release mode, &#x201C;&lt;em&gt;Run without debugging&lt;/em&gt;&#x201D; (Ctrl&#x2B;Shift&#x2B;F9) or even &#x201C;&lt;em&gt;Run&lt;/em&gt;&#x201D; (F9) in Debug mode. However, when breakpoints are used, stepping over certain breakpoints causes random, catastrophic Access Violations deep inside the assembly routines.&lt;/p&gt;&#xA;&lt;p&gt;Since placing breakpoints altered the timing and masked the issue, I wrote a custom, nearly zero-overhead, lock-free logger using &lt;code&gt;lock xadd&lt;/code&gt; and &lt;code&gt;rdtsc&lt;/code&gt; instructions to time-stamp the event and dump raw CPU registers into a pre-allocated memory block without waking the OS thread scheduler.&lt;/p&gt;&#xA;&lt;p&gt;What the lock-free logger revealed was shocking. Under heavy thread contention, if a thread hits a breakpoint and pauses, resuming it (F9) &lt;strong&gt;occasionally&lt;/strong&gt; causes &lt;strong&gt;64-bit parameter register corruption&lt;/strong&gt; (RCX, RDX, etc.). This happened when I placed the breakpoint right on the place I called the virtual assembly routine from (logging immediately before the call, and at the very first line of the assembly routine).&lt;/p&gt;&#xA;&lt;p&gt;For example, my logger captured RCX entering a routine as a valid 64-bit pointer:&lt;br /&gt;&#xA;&lt;code&gt;PRE-BREAKPOINT: 00007FF49F698690&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;After the IDE paused on the breakpoint and I pressed F9 to resume, the immediate next instruction logged the exact same register as:&lt;br /&gt;&#xA;&lt;code&gt;POST-BREAKPOINT: 000000009F698690&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;The upper 32 bits were completely zeroed out, effectively decapitating the pointer and causing an immediate access violation when dereferenced.&lt;/p&gt;&#xA;&lt;p&gt;This likely does &lt;em&gt;not&lt;/em&gt; happen in a simple, single-threaded test app. It only manifests under heavy CPU load, with dozens of threads actively rendering and allocating memory, and only after multiple iterations of hitting a breakpoint.&lt;/p&gt;&#xA;&lt;p&gt;Such a decapitated CPU register strongly points to a possible registers&#x2019; restoration bug in Delphi. Moreover, I can&#x2019;t see how a thread can affect other threads&#x2019; CPU data.&lt;/p&gt;&#xA;&lt;p&gt;So, is this a known (or at least suspectable) architectural flaw in the Delphi 64-bit debugger&#x27;s context restoration under stress? Or, Delphi is right here and there is rather a deeply obscure bug in my code?&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Embarcadero&#xAE; Delphi 13 Version 37.0.59082.6021&lt;/em&gt; &lt;em&gt;(32-bit)&lt;/em&gt;&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79963066</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">How to find Google Drive&#x27;s assigned letter?</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="google-drive-api" />
        <author>
            <name>stevenvh</name>
            <uri>https://stackoverflow.com/users/66056</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79963066/how-to-find-google-drives-assigned-letter" />
        <published>2026-06-19T09:02:11Z</published>
        <updated>2026-06-22T11:48:04Z</updated>
        <summary type="html">
            &lt;p&gt;I have a Delphi program which needs to know Google Drive&#x27;s drive letter. It appears that the default friendly name is &amp;quot;Google Drive&amp;quot;, so I enumerate my drives and look for that text. This works, but this friendly name can be modified by the user.&lt;/p&gt;&#xA;&lt;p&gt;How can I find Google Drive&#x27;s drive letter more reliably? I searched the registry, but couldn&#x27;t find the currently assigned drive letter (default, &amp;quot;G:\&amp;quot;).&lt;/p&gt;&#xA;&lt;p&gt;OS is Windows 11.&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79960604</id>
        <re:rank scheme="https://stackoverflow.com">1</re:rank>
        <title type="text">In Delphi, how to use the &#x27;implements&#x27; directive with a generic interface type?</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="generics" />
        <author>
            <name>Richard Shuck</name>
            <uri>https://stackoverflow.com/users/12215803</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79960604/in-delphi-how-to-use-the-implements-directive-with-a-generic-interface-type" />
        <published>2026-06-16T11:17:29Z</published>
        <updated>2026-06-18T21:30:01Z</updated>
        <summary type="html">
            &lt;p&gt;I want to contain an interface instance inside a container instance while being able to:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;synchronize lifetime&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;not alter the contained instance&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;be able to resolve the inner interface from the outer, and vice versa&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The problem is that the &lt;code&gt;implements&lt;/code&gt; directive does not support generic types. It gives this error:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;interface type required&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;  IStoreOption = interface&#xA;    [&#x27;{FC40203E-104F-488D-B7B7-4B0D831F6150}&#x27;]&#xA;    procedure Read(Value: IConnection);&#xA;    procedure Write(Value: IConnection);&#xA;  end;&#xA;&#xA;  ITest = interface&#xA;    [&#x27;{84F0DD99-34C6-433D-9FA1-5DAB8BED3386}&#x27;]&#xA;    procedure SayHello;&#xA;  end;&#xA;&#xA;  TTest = class(TInterfacedObject, ITest)&#xA;  protected&#xA;    procedure SayHello;&#xA;  end;&#xA;&#xA;  TStoreOption&amp;lt;T: IInterface&amp;gt; = class(TInterfacedObject, IStoreOption, T)&#xA;  private&#xA;    fValue: T;&#xA;  protected&#xA;    property Value: T read fValue implements T;&#xA;  public&#xA;    constructor Create(Value: T);&#xA;    procedure Read(Value: IConnection);&#xA;    procedure Write(Value: IConnection);&#xA;  end;&#xA;&#xA;  function GetTest: ITest;&#xA;  begin&#xA;    var StoreOption := TStoreOption&amp;lt;ITest&amp;gt;.Create(TTest.Create) as IStoreOption;&#xA;    Supports(StoreOption, ITest, Result);&#xA;  end;&#xA;&#xA;  procedure Save(Value: IInterface);&#xA;  begin&#xA;    var StoreOption: IStoreOption;&#xA;    if Supports(Value, IStoreOption, StoreOption) then&#xA;      StoreOption.Write(Connection);&#xA;  end;&#xA;&#xA;  procedure RunTest;&#xA;  begin&#xA;    Save(GetTest);&#xA;  end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;How can I implement this correctly so it works?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79953130</id>
        <re:rank scheme="https://stackoverflow.com">1</re:rank>
        <title type="text">How to migrate Indy to 64bit OpenSSL DLLs?</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="indy" />
            <category scheme="https://stackoverflow.com/tags" term="indy10" />
        <author>
            <name>delphirules</name>
            <uri>https://stackoverflow.com/users/1718632</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79953130/how-to-migrate-indy-to-64bit-openssl-dlls" />
        <published>2026-06-08T17:09:39Z</published>
        <updated>2026-06-09T15:47:33Z</updated>
        <summary type="html">
            &lt;p&gt;I&#x27;m in the process of migrating my Delphi 12 apps from 32bit to 64bit. Currently I&#x27;m using Indy with the 32bit OpenSSL DLLs (libeay32.dll and ssleay32.dll).&lt;/p&gt;&#xA;&lt;p&gt;When I change to 64bit and try to run the app, I get the &#x27;Could not load SSL library&#x27; error. Then I went to GitHub to download 64bit versions of these DLLs from &lt;a href=&quot;https://github.com/IndySockets/OpenSSL-Binaries&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/IndySockets/OpenSSL-Binaries&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Downloaded the file, but there are a lot of folders inside like:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;openssl-1.0.2q-x64_86-win64&#xA;openssl-1.0.2r-x64_86-win64&#xA;openssl-1.0.2s-x64_86-win64&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Tried to use the first one, but still get the same exception. Which one should I use? Even the DLLs inside the x64 folders have &#x27;32&#x27; in their name, so I&#x27;m confused.&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79951852</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">AfterPost or AfterDelete</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="firedac" />
        <author>
            <name>David Jim&#xE9;nez</name>
            <uri>https://stackoverflow.com/users/2391146</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79951852/afterpost-or-afterdelete" />
        <published>2026-06-05T11:56:53Z</published>
        <updated>2026-06-06T05:56:06Z</updated>
        <summary type="html">
            &lt;p&gt;I&#x2019;m working with Delphi 10.4.2, VCL, &lt;code&gt;FireDAC&lt;/code&gt; and &lt;code&gt;EhLib&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In a real application, I have a &lt;code&gt;TFDMemTable&lt;/code&gt; connected to &lt;code&gt;EhLib&lt;/code&gt; data-aware controls, mainly &lt;code&gt;TDBGridEh&lt;/code&gt; and &lt;code&gt;TDBEditEh&lt;/code&gt;. The dataset is loaded from JSON, using &lt;code&gt;CreateDataSet()&lt;/code&gt; / &lt;code&gt;Append()&lt;/code&gt; / field assignment / &lt;code&gt;Post()&lt;/code&gt;. During the JSON load I temporarily disable dataset events and restore them afterwards.&lt;/p&gt;&#xA;&lt;p&gt;The issue is that in the application, in &lt;em&gt;Release&lt;/em&gt; mode, the &lt;code&gt;TFDMemTable&lt;/code&gt; fires &lt;code&gt;BeforePost&lt;/code&gt; and &lt;code&gt;BeforeDelete&lt;/code&gt;, but it does not fire &lt;code&gt;AfterPost&lt;/code&gt; or &lt;code&gt;AfterDelete&lt;/code&gt;. The same &lt;code&gt;TFDMemTable&lt;/code&gt; does fire those &lt;code&gt;After*&lt;/code&gt; events in an isolated test.&lt;/p&gt;&#xA;&lt;p&gt;Some relevant details:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;TFDMemTable&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;VCL application&lt;/li&gt;&#xA;&lt;li&gt;Delphi 10.4.2&lt;/li&gt;&#xA;&lt;li&gt;EhLib controls: &lt;code&gt;TDBGridEh&lt;/code&gt;, &lt;code&gt;TDBEditEh&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Delete&lt;/code&gt; is triggered from &lt;code&gt;TDataSetDelete&lt;/code&gt; / grid UI&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;UpdateOptions.AutoCommitUpdates = True&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;ResourceOptions.SilentMode = True&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;BeforePost&lt;/code&gt; fires&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;BeforeDelete&lt;/code&gt; fires&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;AfterPost&lt;/code&gt; does not fire&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;AfterDelete&lt;/code&gt; does not fire&lt;/li&gt;&#xA;&lt;li&gt;In an isolated test, the events do fire&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Is there any known interaction between EhLib data-aware controls and &lt;code&gt;TFDMemTable&lt;/code&gt; that could prevent &lt;code&gt;AfterPost&lt;/code&gt; / &lt;code&gt;AfterDelete&lt;/code&gt; from being fired, or alter the dataset state/action flow in a way that skips those events?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79951487</id>
        <re:rank scheme="https://stackoverflow.com">2</re:rank>
        <title type="text">Interlocked functions on unsigned variables</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="unsigned" />
            <category scheme="https://stackoverflow.com/tags" term="interlocked" />
        <author>
            <name>vincent</name>
            <uri>https://stackoverflow.com/users/1409617</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79951487/interlocked-functions-on-unsigned-variables" />
        <published>2026-06-04T15:49:10Z</published>
        <updated>2026-06-04T19:31:21Z</updated>
        <summary type="html">
            &lt;p&gt;what is the safe and correct way to atomically write unsigned variables using the Interlocked* functions or TInterlocked?&lt;/p&gt;&#xA;&lt;p&gt;In the function below, are (A) and (B) fully atomic and threadsafe?&lt;br /&gt;&#xA;Or is (C) or (D) required?&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;procedure TForm1.Button3Click(Sender: TObject);&#xA;var&#xA;  tLastReload: UInt64;&#xA;begin&#xA;  TInterlocked.Exchange(Int64(tLastReload),1);  //A&#xA;  InterlockedExchange64(Int64(tLastReload),2);  //B&#xA;&#xA;  TInterlocked.Exchange(PInt64(@tLastReload)^,3); //C&#xA;  InterlockedExchange64(PInt64(@tLastReload)^,4); //D&#xA;end;&#xA;&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79951413</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">DELPHI : [dcc64 Fehler] E1026 File not found : &#x27;DUnitX.Loggers.GUI.VCL.dfm&#x27;</title>
            <category scheme="https://stackoverflow.com/tags" term="windows" />
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="dunit" />
        <author>
            <name>Franz</name>
            <uri>https://stackoverflow.com/users/1362082</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79951413/delphi-dcc64-fehler-e1026-file-not-found-dunitx-loggers-gui-vcl-dfm" />
        <published>2026-06-04T13:27:15Z</published>
        <updated>2026-06-25T18:22:14Z</updated>
        <summary type="html">
            &lt;p&gt;I need some help getting  my DUNIT testcases up and compiling again after  the upgrade to DELPHI 11.&lt;/p&gt;&#xA;&lt;p&gt;This is the top of my command-line testcase program; it is compiling and functional.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;{$IFNDEF TESTINSIGHT}&#xA;{$APPTYPE CONSOLE}&#xA;{$ENDIF}{$STRONGLINKTYPES ON}&#xA;uses&#xA;  {$IFDEF TESTINSIGHT}&#xA;  TestInsight.DUnitX,&#xA;  {$ENDIF }&#xA;  System.SysUtils,&#xA;  DUnitX.Loggers.Console,&#xA;  DUnitX.Loggers.Xml.NUnit,&#xA;  //DUnitX.Loggers.GUI.VCL,&#xA;  DUnitX.TestFramework,&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The GUI Version is basically the same, but here the unit :  &#x27;DUnitX.Loggers.GUI.VCL.dfm&#x27;  is needed .&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;{$R *.res}&#xA;uses&#xA;  Vcl.Forms,&#xA;  System.SysUtils,&#xA;  DUnitX.Loggers.XML.NUnit,&#xA;  DUnitX.Test,&#xA;  DUnitX.TestFixture,&#xA;  DUnitX.TestFramework,&#xA;  DUnitX.TestResult,&#xA;  DUnitX.RunResults,&#xA;  DUnitX.TestRunner,&#xA;  DUnitX.Utils,&#xA;  DUnitX.WeakReference,&#xA;  DUnitX.Windows.Console,&#xA;  DUnitX.Loggers.Null,&#xA;  DUnitX.MemoryLeakMonitor.Default,&#xA;  DUnitX.AutoDetect.Console,&#xA;  DUnitX.ConsoleWriter.Base,&#xA;  DUnitX.Extensibility,&#xA;  DUnitX.Extensibility.PluginManager,&#xA;  DUnitX.FixtureProviderPlugin,&#xA;  DUnitX.FixtureResult,&#xA;  DUnitX.Generics,&#xA;  DUnitX.InternalInterfaces,&#xA;  DUnitX.IoC,&#xA;  DUnitX.Loggers.Console,&#xA;  DUnitX.CommandLine.OptionDef,&#xA;  DUnitX.CommandLine.Options,&#xA;  DUnitX.CommandLine.Parser,&#xA;  DUnitX.OptionsDefinition,&#xA;  DUnitX.Banner,&#xA;  DUnitX.FilterBuilder,&#xA;  DUnitX.Filters,&#xA;  DUnitX.CategoryExpression,&#xA;  DUnitX.TestNameParser,&#xA;  // DUnitX.Loggers.GUI.VCL,&#xA;  DUnitX.Timeout,&#xA;  DUnitX.Exceptions,&#xA;  DUnitX.ResStrs,&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The  compiler claims the unit   has  not been found. If I try to  remove this  unit, compilation fails here&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Application.CreateForm(TGUIVCLTestRunner, GUIVCLTestRunner);&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Q:   how to fix my  DUNITX installation ,  why is this  unit not found&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79950715</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">DELPHI : Working with many different monitor config&#x27;s</title>
            <category scheme="https://stackoverflow.com/tags" term="windows" />
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
        <author>
            <name>Franz</name>
            <uri>https://stackoverflow.com/users/1362082</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79950715/delphi-working-with-many-different-monitor-configs" />
        <published>2026-06-03T08:38:37Z</published>
        <updated>2026-06-04T10:32:21Z</updated>
        <summary type="html">
            &lt;p&gt;I&#x27;m using Delphi 11 and have upgraded from Delphi 10.4. Since the upgrade, I&#x27;ve noticed some very weird behavior in the Delphi IDE. Whenever I load a new project, the IDE shrinks to a minimized/tiny window (about 300 px &#xD7; 50 px) on my monitor. I then have to click the maximize button (top-right) to restore it.&lt;/p&gt;&#xA;&lt;p&gt;Moreover, some of the dialog windows do not match in size correctly, therefore the &amp;quot;OK&amp;quot; button is not visible and I can&#x27;t use the function.&lt;/p&gt;&#xA;&lt;p&gt;Additionally, Delphi always jumps to my first monitor, but I want Delphi to always stay on Monitor #2.&lt;/p&gt;&#xA;&lt;p&gt;I have several physical workplaces, and each place has a different monitor configuration. In my home office, I have the laptop display and 2 additional 4K monitors with different resolutions.&lt;/p&gt;&#xA;&lt;p&gt;I want Delphi always to open  on monitor #2 and  full window mode.&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79950586</id>
        <re:rank scheme="https://stackoverflow.com">1</re:rank>
        <title type="text">Possible race in TIdUDPServer.CloseBinding: listener thread keeps raw Binding reference while CloseBinding closes it before WaitFor</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="indy" />
        <author>
            <name>Sargis</name>
            <uri>https://stackoverflow.com/users/8050679</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79950586/possible-race-in-tidudpserver-closebinding-listener-thread-keeps-raw-binding-re" />
        <published>2026-06-03T02:50:21Z</published>
        <updated>2026-06-03T18:46:59Z</updated>
        <summary type="html">
            &lt;p&gt;I am investigating an intermittent AV during rapid &lt;code&gt;TIdUDPServer.Active := False/True&lt;/code&gt;&#xA;cycles in a Delphi 12.2 application.&lt;/p&gt;&#xA;&lt;p&gt;The crash happens in the UDP close path, at:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;TIdUDPServer.CloseBinding&#xA;  LListener.Binding.CloseSocket;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I checked the stock Indy source shipped with Delphi 12.2:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;C:\Program Files (x86)\Embarcadero\Studio\23.0\source\Indy10\Core\IdUDPServer.pas&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The relevant code has this ownership/order pattern:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;procedure TIdUDPServer.CloseBinding;&#xA;begin&#xA;  LListenerThreads := FListenerThreads.LockList;&#xA;  try&#xA;    while LListenerThreads.Count &amp;gt; 0 do begin&#xA;      LListener := TIdUDPListenerThread(LListenerThreads[0]);&#xA;&#xA;      LListener.Stop;&#xA;      LListener.Binding.CloseSocket;&#xA;      LListener.WaitFor;&#xA;      LListener.Free;&#xA;      LListenerThreads.Delete(0);&#xA;    end;&#xA;  finally&#xA;    FListenerThreads.UnlockList;&#xA;  end;&#xA;end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The listener thread also touches the same binding from its own thread:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;procedure TIdUDPListenerThread.AfterRun;&#xA;begin&#xA;  inherited AfterRun;&#xA;  FBinding.CloseSocket;&#xA;end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The listener stores the binding as a raw object reference:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;TIdUDPListenerThread = class(TIdThread)&#xA;protected&#xA;  FBinding: TIdSocketHandle;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;TIdThread.Stop&lt;/code&gt; only sets the stopped/terminated state. It does not wait for the&#xA;thread to finish. &lt;code&gt;WaitFor&lt;/code&gt; is called only after &lt;code&gt;LListener.Binding.CloseSocket&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So the ownership model seems to be:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;TIdUDPServer.Bindings&lt;/code&gt; owns the &lt;code&gt;TIdSocketHandle&lt;/code&gt; objects.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;TIdUDPListenerThread&lt;/code&gt; stores a non-owning &lt;code&gt;FBinding&lt;/code&gt; reference to one of them.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;CloseBinding&lt;/code&gt; locks only the listener list, not the binding lifetime.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;TIdSocketHandle.CloseSocket&lt;/code&gt; locks the socket handle fields of a live object,&#xA;but it does not pin the lifetime of the &lt;code&gt;TIdSocketHandle&lt;/code&gt; object itself.&lt;/li&gt;&#xA;&lt;li&gt;The listener thread may still run &lt;code&gt;AfterRun&lt;/code&gt; and touch &lt;code&gt;FBinding&lt;/code&gt; while the&#xA;owner thread is already in &lt;code&gt;CloseBinding&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In an instrumented run I saw a listener that was created with a valid socket&#xA;handle, then during shutdown its &lt;code&gt;FBinding.Handle&lt;/code&gt; became a garbage value before&#xA;the AV:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;bind #0 handle=972&#xA;bind #1 handle=1084&#xA;listener #0 STARTED&#xA;listener #1 STARTED&#xA;CloseBinding -&amp;gt; listener #0&#xA;AfterRun: listener #0 closes handle=3145776&#xA;AV at LListener.Binding.CloseSocket&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This does not look like a harmless double &lt;code&gt;CloseSocket&lt;/code&gt; on the same live object.&#xA;If both threads reached the same live &lt;code&gt;TIdSocketHandle&lt;/code&gt;, &lt;code&gt;FConnectionHandle&lt;/code&gt;&#xA;inside &lt;code&gt;TIdSocketHandle.CloseSocket&lt;/code&gt; should serialize the close. The problem&#xA;appears to be that the listener&#x27;s &lt;code&gt;FBinding&lt;/code&gt; reference is no longer a coherent&#xA;live binding object by the time shutdown code uses it.&lt;/p&gt;&#xA;&lt;p&gt;Questions:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is &lt;code&gt;TIdUDPServer.CloseBinding&lt;/code&gt; intended to be safe under rapid&#xA;&lt;code&gt;Active := False&lt;/code&gt; / &lt;code&gt;Active := True&lt;/code&gt; cycles?&lt;/li&gt;&#xA;&lt;li&gt;Is the ordering in &lt;code&gt;CloseBinding&lt;/code&gt; correct? In particular, should it call&#xA;&lt;code&gt;LListener.Binding.CloseSocket&lt;/code&gt; before &lt;code&gt;LListener.WaitFor&lt;/code&gt;, while the listener&#xA;thread can still execute &lt;code&gt;AfterRun&lt;/code&gt; and use &lt;code&gt;FBinding&lt;/code&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Is there an official Indy workaround? For example:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;avoid auto-created dual IPv4/IPv6 bindings and explicitly create one binding;&lt;/li&gt;&#xA;&lt;li&gt;never clear/change &lt;code&gt;Bindings&lt;/code&gt; after activation;&lt;/li&gt;&#xA;&lt;li&gt;serialize &lt;code&gt;Active&lt;/code&gt; changes externally;&lt;/li&gt;&#xA;&lt;li&gt;patch &lt;code&gt;CloseBinding&lt;/code&gt; to stop/wake/wait in a different order.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;p&gt;I investigated this further, and I think the original suspicion about&#xA;&lt;code&gt;TIdUDPServer.CloseBinding()&lt;/code&gt; was probably wrong.&lt;/p&gt;&#xA;&lt;p&gt;The real issue in my code is most likely that I call &lt;code&gt;TIdUDPServer.SendBuffer()&lt;/code&gt;&#xA;from one thread while another thread controls the server lifecycle&#xA;(&lt;code&gt;Active := False/True&lt;/code&gt;, reconnect/shutdown).&lt;/p&gt;&#xA;&lt;p&gt;In my application the UDP reader path can send packets, and the owner/runtime&#xA;thread can also send packets and recreate the UDP server. I could not find a&#xA;clear statement that all &lt;code&gt;TIdUDPServer&lt;/code&gt; access has to be serialized by the&#xA;application, or that &lt;code&gt;SendBuffer()&lt;/code&gt; must not race with &lt;code&gt;Active&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This small repro shows the part that surprised me:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;program IndyUdpAvMvp;&#xA;&#xA;{$APPTYPE CONSOLE}&#xA;&#xA;uses&#xA;  System.SysUtils,&#xA;  System.Classes,&#xA;  Winapi.Windows,&#xA;  IdGlobal,&#xA;  IdSocketHandle,&#xA;  IdUDPServer;&#xA;&#xA;type&#xA;  TEvents = class&#xA;    procedure UDPException(AThread: TIdUDPListenerThread; ABinding: TIdSocketHandle;&#xA;      const AMessage: string; const AExceptionClass: TClass);&#xA;  end;&#xA;&#xA;  TSender = class(TThread)&#xA;  protected&#xA;    procedure Execute; override;&#xA;  end;&#xA;&#xA;var&#xA;  S: TIdUDPServer;&#xA;  Events: TEvents;&#xA;&#xA;procedure TEvents.UDPException(AThread: TIdUDPListenerThread; ABinding: TIdSocketHandle;&#xA;  const AMessage: string; const AExceptionClass: TClass);&#xA;begin&#xA;  Writeln(&#x27;OnUDPException: &#x27;, AExceptionClass.ClassName, &#x27;: &#x27;, AMessage);&#xA;end;&#xA;&#xA;procedure TSender.Execute;&#xA;var&#xA;  B: TIdBytes;&#xA;begin&#xA;  SetLength(B, 1);&#xA;  Sleep(50);&#xA;  If not Terminated then&#xA;    S.SendBuffer(&#x27;127.0.0.1&#x27;, 54000, Id_IPv4, B);&#xA;end;&#xA;&#xA;var&#xA;  T: TSender;&#xA;&#xA;begin&#xA;  Events := TEvents.Create;&#xA;  S := TIdUDPServer.Create(nil);&#xA;  try&#xA;    S.DefaultPort := 54000;&#xA;    S.OnUDPException := Events.UDPException;&#xA;    S.Active := true;&#xA;    T := TSender.Create(false);&#xA;    try&#xA;      S.Active := false;&#xA;      T.WaitFor;&#xA;    finally&#xA;      T.Free;&#xA;    end;&#xA;    S.Bindings.ClearAndResetID;&#xA;    S.Binding.CloseSocket;&#xA;  finally&#xA;    S.Free;&#xA;    Events.Free;&#xA;  end;&#xA;end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;On my machine this raises:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;Exception EAccessViolation in module IndyUdpAvMvp.exe ...&#xA;Read of address 0000000000000000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;code&gt;OnUDPException&lt;/code&gt; is not called.&lt;/p&gt;&#xA;&lt;p&gt;My current understanding is:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;TIdUDPServer.SendBuffer()&lt;/code&gt; is not just a passive send operation. It goes&#xA;through &lt;code&gt;Binding&lt;/code&gt;, and for &lt;code&gt;TIdUDPServer&lt;/code&gt; accessing &lt;code&gt;Binding&lt;/code&gt; may allocate and&#xA;bind sockets and start listener threads.&lt;/li&gt;&#xA;&lt;li&gt;Therefore, calling &lt;code&gt;SendBuffer()&lt;/code&gt; after or during &lt;code&gt;Active := False&lt;/code&gt; can&#xA;effectively activate the server again.&lt;/li&gt;&#xA;&lt;li&gt;So the correct fix on my side is to serialize &lt;code&gt;SendBuffer()&lt;/code&gt; with server&#xA;lifecycle changes, or avoid base &lt;code&gt;TIdUDPServer.SendBuffer()&lt;/code&gt; in late-send paths&#xA;and send only through an already-existing live binding.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Is this interpretation correct? In other words, should &lt;code&gt;TIdUDPServer.SendBuffer()&lt;/code&gt;&#xA;be treated as lifecycle-affecting and not safe to race with &lt;code&gt;Active&lt;/code&gt; changes?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79943994</id>
        <re:rank scheme="https://stackoverflow.com">1</re:rank>
        <title type="text">How to load Excel date cell</title>
            <category scheme="https://stackoverflow.com/tags" term="excel" />
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
        <author>
            <name>Carlos Matos</name>
            <uri>https://stackoverflow.com/users/8343727</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79943994/how-to-load-excel-date-cell" />
        <published>2026-05-20T11:06:41Z</published>
        <updated>2026-05-22T11:38:39Z</updated>
        <summary type="html">
            &lt;p&gt;I&#x27;m using OfficeXML4D library for Delphi and when I do something like this:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Sheet.Cell[&#x27;F2&#x27;].AsDateTime := Now;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;What happens is that the date will show 2096-05-20, instead of 2026-05-20.&lt;/p&gt;&#xA;&lt;p&gt;I checked .AsDateTime, which is:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;procedure TExcelCell.SetAsDateTime(const Value: TDateTime);&#xA;begin&#xA;  FDateTimeValue := Value;&#xA;  FFloatValue := Value &#x2B; ExcelDateOffset;&#xA;  FCellType := TCellType.DateTime;&#xA;end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So, the problem seems to be in:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;FFloatValue := Value &#x2B; ExcelDateOffset;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;If I remove ExcelDateOffset, the date will be loaded just fine. Can anyone explain why this is like this and if it is ok to remove that from the code?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79939461</id>
        <re:rank scheme="https://stackoverflow.com">2</re:rank>
        <title type="text">How to notify a (Spring4D) TObjectDataSet when a bound object property has changed</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="dbgrid" />
            <category scheme="https://stackoverflow.com/tags" term="tdbgrid" />
            <category scheme="https://stackoverflow.com/tags" term="spring4d" />
            <category scheme="https://stackoverflow.com/tags" term="tdataset" />
        <author>
            <name>Richard Shuck</name>
            <uri>https://stackoverflow.com/users/12215803</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79939461/how-to-notify-a-spring4d-tobjectdataset-when-a-bound-object-property-has-chang" />
        <published>2026-05-11T15:42:18Z</published>
        <updated>2026-05-12T10:27:23Z</updated>
        <summary type="html">
            &lt;p&gt;The value shown in an attached grid is updated when using&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;  ObjectDataSet.FieldByName(&#x27;Description&#x27;).AsString:=&#x27;Bob&#x27;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But not when calling&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;  ObjectDataSet.GetCurrentModel&amp;lt;TSaleLine&amp;gt;.Description:=&#x27;Bob&#x27;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This is understandable as the TObjectDataSet is not monitoring the object properties and therefore unaware of the change.&lt;/p&gt;&#xA;&lt;p&gt;I want to add onpropertychanged support to TObjectDataSet to monitor changes to the current model which will then in turn fire a DataEvent(deFieldChange,&amp;lt;field&amp;gt;) as the field change does but am unable to figure out how to trigger it.&lt;/p&gt;&#xA;&lt;p&gt;I have tried the following but no dice.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;type&#xA;  TL = class(TGridDataLink);&#xA;&#xA;begin&#xA;  ObjectDataSet.GetCurrentModel&amp;lt;TSaleLine&amp;gt;.Description:=&#x27;Bob&#x27;;&#xA;&#xA;  var G:=TGridDataLink.Create(Grid);&#xA;  TL(G).RecordChanged(ObjectDataSet.FieldByName(&#x27;Description&#x27;));&#xA;  G.Free;&#xA;end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79939382</id>
        <re:rank scheme="https://stackoverflow.com">3</re:rank>
        <title type="text">How get screenshot of offscreen window?</title>
            <category scheme="https://stackoverflow.com/tags" term="windows" />
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="screenshot" />
            <category scheme="https://stackoverflow.com/tags" term="delphi-10.4-sydney" />
        <author>
            <name>JOTA</name>
            <uri>https://stackoverflow.com/users/22401964</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79939382/how-get-screenshot-of-offscreen-window" />
        <published>2026-05-11T13:19:18Z</published>
        <updated>2026-05-13T19:14:55Z</updated>
        <summary type="html">
            &lt;p&gt;How to get a continuous screenshot of a window that is not visible on the screen (offscreen)?&lt;/p&gt;&#xA;&lt;p&gt;I have the following code that initially seemed to work, but this got only the first frame (when the target window is updated, the screenshot still is the first frame). Are there other approaches to achieve this?&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;unit Unit1;&#xA;&#xA;interface&#xA;&#xA;uses&#xA;  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,&#xA;  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls;&#xA;&#xA;type&#xA;  TForm1 = class(TForm)&#xA;    Timer1: TTimer;&#xA;    procedure Timer1Timer(Sender: TObject);&#xA;  end;&#xA;&#xA;var&#xA;  Form1: TForm1;&#xA;&#xA;implementation&#xA;&#xA;{$R *.dfm}&#xA;&#xA;function ActiveCaption: string;&#xA;var&#xA;  Handle: THandle;&#xA;  Len: LongInt;&#xA;  Title: string;&#xA;begin&#xA;  Result := &#x27;&#x27;;&#xA;  Handle := GetForegroundWindow;&#xA;  if Handle &amp;lt;&amp;gt; 0 then&#xA;  begin&#xA;    Len := GetWindowTextLength(Handle) &#x2B; 1;&#xA;    SetLength(Title, Len);&#xA;    GetWindowText(Handle, PChar(Title), Len);&#xA;    ActiveCaption := TrimRight(Title);&#xA;  end;&#xA;end;&#xA;&#xA;procedure ScreenShotWindow;&#xA;var&#xA;  DC: HDC;&#xA;  wRect: TRect;&#xA;  Bmp: TBitmap;&#xA;  Width, Height: Integer;&#xA;  H: HWnd;&#xA;  title: array[0..MAX_PATH]of char;&#xA;begin&#xA;  H := FindWindow(nil, PWideChar(ActiveCaption));  &#xA;  if H = 0 then&#xA;    Exit;&#xA;&#xA;  DC := GetWindowDC(H);&#xA;  try&#xA;    Bmp := TBitmap.Create;&#xA;    try&#xA;      GetWindowRect(H, wRect);&#xA;      Width := wRect.Right - wRect.Left;&#xA;      Height := wRect.Bottom - wRect.Top;&#xA;      Bmp.SetSize(Width, Height);&#xA;      BitBlt(Bmp.Canvas.Handle, 0, 0, Width, Height, DC, 0, 0, SRCCOPY);&#xA;      Form1.Canvas.Draw(0, 0, Bmp);&#xA;    finally&#xA;      Bmp.Free;&#xA;    end;&#xA;  finally&#xA;    ReleaseDC(H, DC);&#xA;  end;&#xA;end;&#xA;&#xA;procedure TForm1.Timer1Timer(Sender: TObject);&#xA;begin&#xA;   ScreenShotWindow;&#xA;end;&#xA;&#xA;end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I still have hope that it is possible, otherwise, I understood that it is &lt;a href=&quot;https://stackoverflow.com/questions/4176340/how-to-take-a-screenshot-of-a-full-size-window-in-c-sharp/4176486#comment4645722_4176486&quot;&gt;a system limitation&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.sstatic.net/gw1a9mHI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.sstatic.net/gw1a9mHI.png&quot; alt=&quot;quoting Remy: &amp;quot;If it&#x27;s not on-screen, Windows doesn&#x27;t physically render it.&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79936938</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">TWebBrowser.Silent = TRUE still shows &quot;bad certificate&quot; error</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="delphi-7" />
            <category scheme="https://stackoverflow.com/tags" term="twebbrowser" />
        <author>
            <name>H&#xE9;ctor C.</name>
            <uri>https://stackoverflow.com/users/4105601</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79936938/twebbrowser-silent-true-still-shows-bad-certificate-error" />
        <published>2026-05-06T10:46:28Z</published>
        <updated>2026-05-06T11:39:17Z</updated>
        <summary type="html">
            &lt;p&gt;I have a &lt;code&gt;TWebBrowser&lt;/code&gt; with the &lt;code&gt;.Silent&lt;/code&gt; property set to &lt;code&gt;True&lt;/code&gt;, but it&#x27;s still popping up the message&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Revocation information for the security certificate for this site is not available. Do you want to proceed?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;unit browsertest;&#xA;&#xA;interface&#xA;&#xA;uses&#xA;  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,&#xA;  Dialogs, StdCtrls, OleCtrls, SHDocVw;&#xA;&#xA;type&#xA;  TForm1 = class(TForm)&#xA;    WebBrowser1: TWebBrowser;&#xA;    Button1: TButton;&#xA;    procedure Button1Click(Sender: TObject);&#xA;  private&#xA;    { Private declarations }&#xA;  public&#xA;    { Public declarations }&#xA;  end;&#xA;&#xA;var&#xA;  Form1: TForm1;&#xA;&#xA;implementation&#xA;&#xA;{$R *.dfm}&#xA;&#xA;procedure TForm1.Button1Click(Sender: TObject);&#xA;begin&#xA;  self.WebBrowser1.Silent := True;&#xA;  self.WebBrowser1.Navigate(&#x27;http://...&#x27;);&#xA;end;&#xA;&#xA;end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.sstatic.net/mB4GAQDs.png&quot; alt=&quot;Internet Explorer&#x27;s certificate error dialog window&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;How can I solve this so the popup doesn&#x27;t appear? It must be done programatically, so editing Internet Preferences is out of question (as this is distributed to thousands of clients).&lt;/p&gt;&#xA;&lt;p&gt;This message appears on some computers, but not in all of them.&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79932029</id>
        <re:rank scheme="https://stackoverflow.com">2</re:rank>
        <title type="text">Delphi &#x2B; PAServer: How to correctly export iOS app with Notification Service Extension (appex) &#x2013; missing provisioningProfiles in exportOptions.plist</title>
            <category scheme="https://stackoverflow.com/tags" term="ios" />
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="firemonkey" />
        <author>
            <name>zeus</name>
            <uri>https://stackoverflow.com/users/1114043</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79932029/delphi-paserver-how-to-correctly-export-ios-app-with-notification-service-ext" />
        <published>2026-04-26T11:32:32Z</published>
        <updated>2026-04-30T07:51:42Z</updated>
        <summary type="html">
            &lt;p&gt;I&#x2019;m deploying an iOS app built with Delphi (FMX) using PAServer. The app includes a Notification Service Extension (&lt;code&gt;.appex&lt;/code&gt;).&lt;/p&gt;&#xA;&lt;p&gt;The build succeeds, but the export step fails with:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;error: exportArchive &amp;quot;NotificationService.appex&amp;quot; requires a provisioning profile.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h3&gt;Context&lt;/h3&gt;&#xA;&lt;p&gt;App structure:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;MyApp.app/&#xA;  PlugIns/&#xA;    NotificationService.appex/&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Bundle identifiers:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Main app: &lt;code&gt;com.example.myapp&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Extension: &lt;code&gt;com.example.myapp.notificationservice&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Both App Store provisioning profiles exist and are valid.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h3&gt;Problem&lt;/h3&gt;&#xA;&lt;p&gt;PAServer generates this &lt;code&gt;exportOptions.plist&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-xml prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;key&amp;gt;provisioningProfiles&amp;lt;/key&amp;gt;&#xA;&amp;lt;dict&amp;gt;&#xA;  &amp;lt;key&amp;gt;com.example.myapp&amp;lt;/key&amp;gt;&#xA;  &amp;lt;string&amp;gt;com.example.myapp&amp;lt;/string&amp;gt;&#xA;&amp;lt;/dict&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;But the extension is missing. It should be:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-xml prettyprint-override&quot;&gt;&lt;code&gt;&amp;lt;key&amp;gt;provisioningProfiles&amp;lt;/key&amp;gt;&#xA;&amp;lt;dict&amp;gt;&#xA;  &amp;lt;key&amp;gt;com.example.myapp&amp;lt;/key&amp;gt;&#xA;  &amp;lt;string&amp;gt;com.example.myapp&amp;lt;/string&amp;gt;&#xA;  &amp;lt;key&amp;gt;com.example.myapp.notificationservice&amp;lt;/key&amp;gt;&#xA;  &amp;lt;string&amp;gt;com.example.myapp.notificationservice&amp;lt;/string&amp;gt;&#xA;&amp;lt;/dict&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Without this, &lt;code&gt;xcodebuild -exportArchive&lt;/code&gt; fails.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h3&gt;Question&lt;/h3&gt;&#xA;&lt;p&gt;Is there a way to make Delphi / PAServer include app extensions in &lt;code&gt;exportOptions.plist&lt;/code&gt;?&lt;/p&gt;&#xA;&lt;p&gt;Or is manually exporting with &lt;code&gt;xcodebuild&lt;/code&gt; the only solution when using &lt;code&gt;.appex&lt;/code&gt; extensions?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79930592</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">Generic TForm in hiearchy</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="firemonkey" />
        <author>
            <name>David U</name>
            <uri>https://stackoverflow.com/users/1110927</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79930592/generic-tform-in-hiearchy" />
        <published>2026-04-23T08:44:33Z</published>
        <updated>2026-04-24T07:35:18Z</updated>
        <summary type="html">
            &lt;p&gt;I&#x27;m building a fmx app in Delphi 12.2.&lt;/p&gt;&#xA;&lt;p&gt;I would like to create a view hierarchy  that includes a 3rd party generic TForm descendent. This 3rd party TForm does not have an fmx file. It does not appear in the list of inheritable items when I create a new fmx TForm.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-none prettyprint-override&quot;&gt;&lt;code&gt;TForm&#xA;T3rdPartyForm&amp;lt;T&amp;gt; = class(TForm) (no fmx file)&#xA;TViewBase&amp;lt;T&amp;gt; = class(T3rdPartyForm&amp;lt;T&amp;gt;)&#xA;TAppView1 = class(TViewBase&amp;lt;TAClass&amp;gt;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I have created the hierarchy. It compiles and runs. &lt;code&gt;TAppView1&lt;/code&gt; has an &lt;code&gt;.fmx&lt;/code&gt; file that I can edit in the IDE and which appears correctly at run time.&lt;/p&gt;&#xA;&lt;p&gt;But, every time I start Delphi, I get 2 error messages:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Error creating form in View.Base.fmx: Error in module: Declaration of call TViewBase is missing or incorrect.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Error in module: Declaration of call TViewBase is missing or incorrect.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I also get the second message when I click the Design tab of &lt;code&gt;TViewBase&amp;lt;T&amp;gt;&lt;/code&gt;. I don&#x27;t know if the error is because &lt;code&gt;T3rdPartyForm&amp;lt;T&amp;gt;&lt;/code&gt; is generic or because it has no &lt;code&gt;.fmx&lt;/code&gt; file.&lt;/p&gt;&#xA;&lt;p&gt;I would like to be able to edit &lt;code&gt;TViewBase&amp;lt;T&amp;gt;&lt;/code&gt; in the IDE design editor so that its components, as well as its code, can be inherited. I would also like for code completion to work completely and correctly for all forms at the level of &lt;code&gt;TAppView1&lt;/code&gt;, and to reduce the number of fake LSP errors I see when editing &lt;code&gt;TAppView1&lt;/code&gt; and its siblings. I think that all of this is impacted by the errors I am seeing.&lt;/p&gt;&#xA;&lt;p&gt;How do I get the hierarchy I want without errors?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79926312</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">How to load a Delphi TService driver early?</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="service" />
            <category scheme="https://stackoverflow.com/tags" term="driver" />
            <category scheme="https://stackoverflow.com/tags" term="startup" />
        <author>
            <name>WayOfTheWright</name>
            <uri>https://stackoverflow.com/users/12980952</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79926312/how-to-load-a-delphi-tservice-driver-early" />
        <published>2026-04-15T22:53:18Z</published>
        <updated>2026-04-20T04:02:17Z</updated>
        <summary type="html">
            &lt;p&gt;I am wondering what the best approach is to writing a Delphi service (using the &lt;code&gt;TService&lt;/code&gt; class) to load my basic driver that simply writes a message to a file on disk. No network access is needed, or anything advanced.&lt;/p&gt;&#xA;&lt;p&gt;I am unsure of the &lt;code&gt;StartType&lt;/code&gt; setting and &lt;code&gt;LoadGroup&lt;/code&gt; name I need to use. AI keeps suggesting a load group of &amp;quot;System Reserved&amp;quot; from a quick search, but I want better real-world advice from developers that have implemented Delphi &lt;code&gt;TService&lt;/code&gt; apps that use early loading for executing a driver load.&lt;/p&gt;&#xA;&lt;p&gt;I use &lt;code&gt;ZwLoadDriver&lt;/code&gt; directly, in case this matters, as I don&#x27;t use the Service Control Manager that is built-in to Windows.&lt;/p&gt;&#xA;&lt;p&gt;Any suggestions for loading a very basic &amp;quot;Hello world!&amp;quot; driver from an early-started service?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79926191</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">Delphi, hooking TBitmap.Create &amp; stack trace</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="hook" />
            <category scheme="https://stackoverflow.com/tags" term="stack-trace" />
        <author>
            <name>Mark</name>
            <uri>https://stackoverflow.com/users/2976664</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79926191/delphi-hooking-tbitmap-create-stack-trace" />
        <published>2026-04-15T17:43:09Z</published>
        <updated>2026-04-16T16:16:18Z</updated>
        <summary type="html">
            &lt;p&gt;Posting this because I could not find an answer and code produced by two AIs I queried, would not compile. And when I did get it to compile it crashed at some point.&lt;/p&gt;&#xA;&lt;p&gt;I needed to hook TBitmap.Create and log the calling function/procedure name. I did not parse the stack dump from madExcept&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.madexcept.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;madExcept&lt;/a&gt; and &lt;a href=&quot;https://github.com/MahdiSafsafi/DDetours&quot; rel=&quot;nofollow noreferrer&quot;&gt;DDetours&lt;/a&gt; is required.&lt;/p&gt;&#xA;&lt;p&gt;I am using Delphi 10.2&lt;/p&gt;&#xA;&lt;p&gt;Here is code to hook the constructor:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;unit Main;&#xA;&#xA;interface&#xA;&#xA;uses&#xA;  Winapi.Windows,Winapi.Messages,System.SysUtils,System.Variants,System.Classes,Vcl.Graphics,Vcl.Controls,Vcl.Forms,Vcl.Dialogs,DDetours,Vcl.StdCtrls;&#xA;&#xA;type&#xA;  TForm2 = class(TForm)&#xA;    CreateBitmapBtn: TButton;&#xA;    RemoveHookBtn: TButton;&#xA;    procedure CreateBitmapBtnClick(Sender: TObject);&#xA;    procedure RemoveHookBtnClick(Sender: TObject);&#xA;  private&#xA;    { Private declarations }&#xA;  public&#xA;    { Public declarations }&#xA;  end;&#xA;&#xA;var&#xA;  Form2: TForm2;&#xA;&#xA;procedure InstallTBitmapCreateHook;&#xA;procedure RemoveTBitmapCreateHook;&#xA;&#xA;implementation&#xA;&#xA;{$R *.dfm}&#xA;&#xA;uses madStackTrace;&#xA;&#xA;type&#xA; TBitmapCreateFunc = function(self:TBitmap; DoAlloc:Boolean): TBitmap;&#xA;&#xA;var&#xA; TBitmap_Create_Hook:TBitmapCreateFunc = nil;&#xA;&#xA;function Hook_TBitmap_Create(self:TBitmap; DoAlloc:Boolean):TBitmap;&#xA;var&#xA; CallerName: string;&#xA;begin&#xA; CallerName:=StackTrace;                        // Get call stack via madExcept&#xA; ShowMessage(CallerName);&#xA; result:=TBitmap_Create_Hook(self,DoAlloc);     // Call original constructor&#xA;end;&#xA;&#xA;procedure TForm2.CreateBitmapBtnClick(Sender: TObject);&#xA;var&#xA; bMap:TBitMap;&#xA;begin&#xA; bMap:=TBitMap.Create;&#xA; bMap.Free;&#xA;end;&#xA;&#xA;procedure InstallTBitmapCreateHook;&#xA;begin&#xA; TBitmap_Create_Hook:=InterceptCreate(@Vcl.Graphics.TBitmap.Create, @Hook_TBitmap_Create);&#xA;end;&#xA;&#xA;procedure RemoveTBitmapCreateHook;&#xA;begin&#xA; try&#xA;  InterceptRemove(@TBitmap_Create_Hook);&#xA; finally&#xA;  TBitmap_Create_Hook:=nil;&#xA; end;&#xA;end;&#xA;&#xA;procedure TForm2.RemoveHookBtnClick(Sender: TObject);&#xA;begin&#xA; RemoveTBitmapCreateHook;&#xA;end;&#xA;&#xA;initialization&#xA; InstallTBitmapCreateHook;&#xA;&#xA;finalization&#xA; RemoveTBitmapCreateHook;&#xA;&#xA;end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And here is code to hook &lt;code&gt;AfterConstruction()&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;unit Main2;&#xA;&#xA;interface&#xA;&#xA;uses&#xA;  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,&#xA;  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,DDetours;&#xA;&#xA;type&#xA;  TForm3 = class(TForm)&#xA;    CreateBitmapBtn: TButton;&#xA;    RemoveHookBtn: TButton;&#xA;    Memo1: TMemo;&#xA;    procedure CreateBitmapBtnClick(Sender: TObject);&#xA;    procedure RemoveHookBtnClick(Sender: TObject);&#xA;  private&#xA;    { Private declarations }&#xA;  public&#xA;    { Public declarations }&#xA;  end;&#xA;&#xA;var&#xA;  Form3: TForm3;&#xA;&#xA;implementation&#xA;&#xA;{$R *.dfm}&#xA;&#xA;uses madStackTrace;&#xA;&#xA;type&#xA; TAfterConstructionProc = procedure(Self: TBitmap);&#xA;&#xA;var&#xA; Trampoline_TBitmap_AfterConstruction: TAfterConstructionProc = nil;&#xA;&#xA;procedure Intercept_TBitmap_AfterConstruction(Self: TBitmap);&#xA;var&#xA; CallerName: string;&#xA;begin&#xA; CallerName:=StackTrace;                        // Get call stack via madExcept&#xA; if Assigned(Form3) and Assigned(Form3.Memo1) then&#xA;  Form3.Memo1.Lines.Add(CallerName);&#xA;&#xA; if Assigned(Trampoline_TBitmap_AfterConstruction) then&#xA;  Trampoline_TBitmap_AfterConstruction(Self);&#xA;end;&#xA;&#xA;procedure InstallBitmapHook;&#xA;begin&#xA; if not Assigned(Trampoline_TBitmap_AfterConstruction) then&#xA;  begin&#xA;   @Trampoline_TBitmap_AfterConstruction:=InterceptCreate(@TBitmap.AfterConstruction,&#xA;                                                          @Intercept_TBitmap_AfterConstruction);&#xA;  end;&#xA;end;&#xA;&#xA;procedure RemoveBitmapHook;&#xA;begin&#xA; if Assigned(Trampoline_TBitmap_AfterConstruction) then&#xA;  begin&#xA;   InterceptRemove(@Trampoline_TBitmap_AfterConstruction);&#xA;   Trampoline_TBitmap_AfterConstruction:=nil;&#xA;  end;&#xA;end;&#xA;&#xA;procedure TForm3.CreateBitmapBtnClick(Sender: TObject);&#xA;var&#xA; bMap:TBitMap;&#xA;begin&#xA; bMap:=TBitMap.Create;&#xA; bMap.Free;&#xA;end;&#xA;&#xA;procedure TForm3.RemoveHookBtnClick(Sender: TObject);&#xA;begin&#xA; RemoveBitmapHook;&#xA;end;&#xA;&#xA;initialization&#xA; InstallBitmapHook;&#xA;&#xA;finalization&#xA; RemoveBitmapHook;&#xA;&#xA;end.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79922738</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">THTTPRio Authorization Bearer</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="bearer-token" />
            <category scheme="https://stackoverflow.com/tags" term="delphi-10.2-tokyo" />
        <author>
            <name>Carlos Matos</name>
            <uri>https://stackoverflow.com/users/8343727</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79922738/thttprio-authorization-bearer" />
        <published>2026-04-09T10:27:20Z</published>
        <updated>2026-04-27T16:41:43Z</updated>
        <summary type="html">
            &lt;p&gt;I&#x27;m using Delphi Tokio 10.2.3 and using a THTTPRIO component to consume a SOAP webservice.&lt;/p&gt;&#xA;&lt;p&gt;I need/must use Bearer token authentication on the request, because the service was changed from basic authentication (username/password) to bearer token.&lt;/p&gt;&#xA;&lt;p&gt;How can I set/add the token to the header request using THTTPRIO?&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79921668</id>
        <re:rank scheme="https://stackoverflow.com">3</re:rank>
        <title type="text">How to implement a scoped context in Spring4D?</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="spring4d" />
        <author>
            <name>Richard Shuck</name>
            <uri>https://stackoverflow.com/users/12215803</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79921668/how-to-implement-a-scoped-context-in-spring4d" />
        <published>2026-04-07T15:49:32Z</published>
        <updated>2026-04-08T10:31:57Z</updated>
        <summary type="html">
            &lt;p&gt;I want to be able to register a scoped singleton which would work like &lt;code&gt;TSingletonPerThreadLifetimeManager&lt;/code&gt; does, but is freed when it goes out of scope.&lt;/p&gt;&#xA;&lt;p&gt;I want to have the ability to treat certain objects as singletons within the context of a scope.&lt;/p&gt;&#xA;&lt;p&gt;In the example below, &lt;code&gt;Context&lt;/code&gt; is used by both &lt;code&gt;TTest&lt;/code&gt; and &lt;code&gt;TSub&lt;/code&gt;. I would want them to both point to the same instance, but be unaware that the other one is using it.&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;type&#xA;  TSub = class(TInterfacedObject, ISub)&#xA;  public&#xA;    constructor Create(Context: IContext);&#xA;  end;&#xA;&#xA;  TTest = class(TInterfacedObject, ITest)&#xA;  public&#xA;    constructor Create(Context: IContext; Sub: ISub);&#xA;  end;&#xA;&#xA;Container.RegisterType&amp;lt;IContext,TContext&amp;gt;.AsScoped;&#xA;Container.RegisterType&amp;lt;ITest,TTest&amp;gt;.AsTransient;&#xA;Container.RegisterType&amp;lt;ISub,TSub&amp;gt;.AsTransient;&#xA;&#xA;var Scope:=TScope.New;&#xA;try&#xA;  var test:=Container.Resolve&amp;lt;ITest&amp;gt;();&#xA;  test.execute;&#xA;finally&#xA;  Scope:=nil;&#xA;end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Ideally, I would not want to reference the container inside the scope, but process a passed in dynamic factory, such as:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;procedure DoInScope(TestFactory: Func&amp;lt;ITest&amp;gt;);&#xA;begin&#xA;  var Scope:=TScope.New;&#xA;  try&#xA;    TestFactory().Execute;&#xA;  finally&#xA;    Scope:=nil;&#xA;  end;&#xA;end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I had a look at &lt;code&gt;TSingletonPerThreadLifetimeManager&lt;/code&gt;, but was unable to figure out how to trigger the references to be freed at the end of scope.&lt;/p&gt;&#xA;&lt;p&gt;Another option I can think of is to use a delegate, such as:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;Container.RegisterType&amp;lt;IContext,TContext&amp;gt;.DelegateTo(&#xA;  function: IContext&#xA;  begin&#xA;    if TScope.InScope then&#xA;    begin&#xA;      if not TScope.Has&amp;lt;IContext&amp;gt; then&#xA;        TScope.Add&amp;lt;IContext&amp;gt;(Container.Resolve&amp;lt;IContext&amp;gt;); // wont work as recursive&#xA;      Result:=TScope.Get&amp;lt;IContext&amp;gt;;&#xA;    end;&#xA;  end&#xA;);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79918244</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">Bad DFM streaming of a TForm displayed in CEF4Delphi TChromium.OnDownloadUpdated event</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="delphi-7" />
            <category scheme="https://stackoverflow.com/tags" term="chromium-embedded" />
            <category scheme="https://stackoverflow.com/tags" term="cef4delphi" />
        <author>
            <name>H&#xE9;ctor C.</name>
            <uri>https://stackoverflow.com/users/4105601</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79918244/bad-dfm-streaming-of-a-tform-displayed-in-cef4delphi-tchromium-ondownloadupdated" />
        <published>2026-04-01T08:57:50Z</published>
        <updated>2026-04-04T18:26:05Z</updated>
        <summary type="html">
            &lt;p&gt;I have a project using CEF4Delphi that uses a custom Open/Save dialog when downloading a file.&lt;/p&gt;&#xA;&lt;p&gt;This is the event when I create the custom form&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;procedure TMainForm.ChromiumDownloadUpdated(Sender: TObject;&#xA;  const browser: ICefBrowser; const downloadItem: ICefDownloadItem;&#xA;  const callback: ICefDownloadItemCallback);&#xA;&#xA;var&#xA;  FileIcon: TIcon;&#xA;  Descripcion: string;&#xA;  originalFilename: string;&#xA;  openSaveForm: TOpenSaveForm;&#xA;begin&#xA;  else if downloadItem.IsComplete then&#xA;  begin&#xA;    FileIcon := TIcon.Create;&#xA;    openSaveForm := TOpenSaveForm.Create(Self);&#xA;    try&#xA;      try&#xA;        openSaveForm.LabelFilename.Caption := OpenSaveFormCaptionMsg(originalFilename, downloadItem.ReceivedBytes);&#xA;        GetFileIconAndDescription(downloadItem.GetFullPath, FileIcon, Descripcion);&#xA;        openSaveForm.RadioButtonOpen.Caption := openSaveForm.RadioButtonOpen.Caption &#x2B; &#x27; &#x27; &#x2B; Descripcion;&#xA;        openSaveForm.FileIcon.Picture.Icon := FileIcon;&#xA;        if openSaveForm.ShowModal = mrOk then&#xA;          ChooseShowSaveDialog(downloadItem.GetFullPath, openSaveForm.RadioButtonSave.Checked);&#xA;      except&#xA;        on E: Exception do&#xA;          ShowMessage(&#x27;Excepcion opensaveform: &#x27; &#x2B; E.Message);&#xA;      end;&#xA;    finally&#xA;      openSaveForm.Free;&#xA;      FileIcon.Free;&#xA;    end;&#xA;  end;&#xA;end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;This form normally appears like this:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.sstatic.net/Fy6UqFTV.png&quot; alt=&quot;Correct form&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;But somethimes the DFM streaming fails and the form appears broken:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.sstatic.net/GP2y23iQ.png&quot; alt=&quot;Broken form&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;If I inspect the properties of the buttons, labels, etc they have Width=0, Left=0, etc, just after being created and before calling OnShow.&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79917574</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">Migrating Delphi application to .NET: Framework 4.8 vs .NET 6&#x2B; for COM/Hydra interop</title>
            <category scheme="https://stackoverflow.com/tags" term=".net" />
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="remobjects" />
        <author>
            <name>sumeet</name>
            <uri>https://stackoverflow.com/users/2243211</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79917574/migrating-delphi-application-to-net-framework-4-8-vs-net-6-for-com-hydra-int" />
        <published>2026-03-31T06:39:21Z</published>
        <updated>2026-04-02T09:53:52Z</updated>
        <summary type="html">
            &lt;p&gt;We&#x27;re planning a phased migration of a large Delphi application to C#/.NET. The migration strategy involves:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Running Delphi and C# side-by-side during transition (12-24 months)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using &lt;strong&gt;RemObjects Hydra&lt;/strong&gt; (or COM interop) for Delphi &#x2194; C# communication&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Gradually replacing Delphi modules with C# equivalents&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;strong&gt;Our dilemma:&lt;/strong&gt; Should we target &lt;strong&gt;.NET Framework 4.8&lt;/strong&gt; initially or go directly to &lt;strong&gt;modern .NET (6/8/10)&lt;/strong&gt;?&lt;/p&gt;&#xA;&lt;h3&gt;Option A: .NET Framework 4.8 &#x2192; Later upgrade&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Well-documented Delphi interop patterns&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Proven Hydra support&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Lower risk during pilot phase&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Requires migration to modern .NET later&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Creates temporary technical debt&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Double deployment/testing effort&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3&gt;Option B: Modern .NET (6/8/10) directly&lt;/h3&gt;&#xA;&lt;p&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;No framework upgrade needed later&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Future-proof from day one&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Single migration path&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Less documented interop scenarios&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Potential runtime hosting issues with Delphi&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Unknown deployment complexities&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3&gt;Specific Technical Questions:&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Has anyone successfully used RemObjects Hydra or COM interop between Delphi and .NET 6&#x2B;?&lt;/strong&gt; What issues did you encounter?&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Are there known blockers for Delphi &#x2194; modern .NET interop&lt;/strong&gt; that would force us to use .NET Framework 4.8?&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;What are the key technical differences&lt;/strong&gt; in hosting/interop between .NET Framework 4.8 and .NET 6&#x2B; that would affect a Delphi bridge?&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h3&gt;Environment:&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Delphi version: 13&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Windows desktop application&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Enterprise deployment&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Gradual module-by-module replacement strategy&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79915872</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">Highlight cells in TCalendar</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="vcl" />
        <author>
            <name>Moore</name>
            <uri>https://stackoverflow.com/users/1584640</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79915872/highlight-cells-in-tcalendar" />
        <published>2026-03-27T16:31:08Z</published>
        <updated>2026-03-29T11:21:45Z</updated>
        <summary type="html">
            &lt;p&gt;Is there any way to highlight various non-contiguous cells in Delphi&#x27;s &lt;code&gt;TCalendar&lt;/code&gt; component at the same time? And not only the actual day?&lt;/p&gt;&#xA;&lt;p&gt;I need to let the user mark different days in different cells, not necessarily contiguous. Either the text or the background, or both, with a different color than the color of non-marked cells.&lt;/p&gt;&#xA;&lt;p&gt;I am using Delphi 12.3.&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79914202</id>
        <re:rank scheme="https://stackoverflow.com">1</re:rank>
        <title type="text">How to convert Delphi *.pas &quot;format ANSI&quot; files to *.pas &quot;format UTF&quot; files? (We are starting to use Cursor IDE on Delphi projects)</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="utf-8" />
            <category scheme="https://stackoverflow.com/tags" term="artificial-intelligence" />
            <category scheme="https://stackoverflow.com/tags" term="ansi" />
        <author>
            <name>TomR</name>
            <uri>https://stackoverflow.com/users/1375882</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79914202/how-to-convert-delphi-pas-format-ansi-files-to-pas-format-utf-files-we" />
        <published>2026-03-25T11:26:22Z</published>
        <updated>2026-06-05T10:01:42Z</updated>
        <summary type="html">
            &lt;p&gt;We have developed Delphi projects in Lithuanian (Baltic) local Windows machines and our Delphi *.pas files have been in &amp;quot;format ANSI&amp;quot; and they, of course, contained Lithuanian constants as well.&lt;/p&gt;&#xA;&lt;p&gt;Now we are starting to use Cursor IDE (&#x2B; the best models, like Claude Opus 4.6 Max or any other top model) to make AI developement on the codebase, but Cursor IDE &#x2B; models are totally incapable to handle ANSI Lithuanian files. Cursor &#x2B; models get confused and overwrites and overwrites Lithuanian texts and complete mess is the sole result. The opening of *.pas files with relevant encoding in Cursor IDE is not helping. The prompts are not helping either - models become unmanageable with this respect.&lt;/p&gt;&#xA;&lt;p&gt;So - I start the pratice to convert *.pas file from ANSI to UTF8 format - Delphi editor offers command &amp;quot;Right click - File Format...&amp;quot; and there is menu to change the format. This conversion worked as far as AI is concerted - the Cursor IDE &#x2B; models are able to program such files perfectly.&lt;/p&gt;&#xA;&lt;p&gt;But if the UTF8 format *.pas files contains string constants with Lithuanian values and those constants are used in the legacy ANSI format *.pas file code, then Strings in both files are incompatible. Even worse, IBX components, that wrote those Lithuanina values into UTF-8 Firebird database perfectly, now are writing complete mess.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;So - there is no other option, than to convert and retest all the *.pas files into UTF8 format. But how to do that conversion? Only working way is to do that manually from the Delphi IDE. I have not find any other way. Delphi IDE definition of ANSI/UTF8 file formats are somehow strange, because - if Cursor IDE is asked to detected them, then it decides that there are no BOMs etc. and gets confused. So - how to handle this conversion?&lt;/strong&gt;&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79911832</id>
        <re:rank scheme="https://stackoverflow.com">3</re:rank>
        <title type="text">How to change the background color of a TButton component with code in Delphi FMX?</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="firemonkey" />
            <category scheme="https://stackoverflow.com/tags" term="delphi-13-florence" />
            <category scheme="https://stackoverflow.com/tags" term="tbutton" />
        <author>
            <name>user31362432</name>
            <uri>https://stackoverflow.com/users/31362432</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79911832/how-to-change-the-background-color-of-a-tbutton-component-with-code-in-delphi-fm" />
        <published>2026-03-21T10:54:48Z</published>
        <updated>2026-06-05T09:40:33Z</updated>
        <summary type="html">
            &lt;p&gt;I&#x27;ve been tasked to dynamically style buttons to be different colors with Delphi code in FMX&lt;/p&gt;&#xA;&lt;p&gt;I want a red &lt;code&gt;TButton&lt;/code&gt; component. My first thought was to use a &lt;code&gt;TRectangle&lt;/code&gt; instead of a &lt;code&gt;TButton&lt;/code&gt;, but then my boss said that he doesn&#x27;t want the components to be changed to something else because we have too many &lt;code&gt;TButton&lt;/code&gt; components already and I should find a way to make it work with &lt;code&gt;TButton&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;We get the colors from the database and now I need to fill the button with those colors. A coworker suggested I try something like this and he sent this code:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;begin&#xA;  var Obj := Button1.FindStyleResource(&#x27;background&#x27;);&#xA;&#xA;  if Obj is TRectangle then&#xA;    TRectangle(Obj).Fill.Color := TAlphaColorRec.Red;&#xA;end;&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;That however didn&#x27;t work at all. He suggested some other similar exampled code that I tried and also didn&#x27;t work. I also tried going back and forth with AI and my coworker&#x27;s code, but nothing worked. My coworkers as well as AI seems convinced that this is possible, but I just can&#x27;t get it to work.&lt;/p&gt;&#xA;&lt;p&gt;I am open to any suggestions or methods as long as it the component stays a &lt;code&gt;TButton&lt;/code&gt; and as long as the color is changed via code during run-time.&lt;/p&gt;&#xA;
        </summary>
    </entry>
    <entry>
        <id>https://stackoverflow.com/q/79911685</id>
        <re:rank scheme="https://stackoverflow.com">0</re:rank>
        <title type="text">delphi Data.DBXEncryption unit exception integer overflow</title>
            <category scheme="https://stackoverflow.com/tags" term="delphi" />
            <category scheme="https://stackoverflow.com/tags" term="encryption" />
        <author>
            <name>CoryB</name>
            <uri>https://stackoverflow.com/users/22268375</uri>
        </author>
        <link rel="alternate" href="https://stackoverflow.com/questions/79911685/delphi-data-dbxencryption-unit-exception-integer-overflow" />
        <published>2026-03-21T01:26:53Z</published>
        <updated>2026-03-21T03:06:48Z</updated>
        <summary type="html">
            &lt;p&gt;Delphi 10.2.3&lt;br /&gt;&#xA;Windows 10 with all current updates&lt;/p&gt;&#xA;&lt;p&gt;I am suddenly getting this exception in Unit &lt;code&gt;Data.DBXEncryption&lt;/code&gt; &lt;code&gt;function TPC1Cypher.Code(const I: Integer): Integer;&lt;/code&gt;&lt;/p&gt;&#xA;&lt;p&gt;Overflow occurs in the line below in Delphi&#x27;s unit and function given above:&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;if Ax &amp;lt;&amp;gt; 0 then  &#xA;   Ax := Ax * Bx;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The above code is directly from Delphi&#x27;s unit and function, unaltered.  I have not altered this code. The values for Ax and Bx are calculated within the function call itself.&lt;/p&gt;&#xA;&lt;p&gt;Because of this overflow username and password won&#x27;t validate where they had been.  Note: I had to reinstall some delphi 10.2.3 and TMS units after I mucked about in System.Classes (I know!) returning it to its original state.  I have not altered any other units (ie DBXEncryption, etc.)&lt;/p&gt;&#xA;&lt;p&gt;Any insight and help is appreciated!&#xA;This code below is directly copied from Delphi&#x27;s unit... It would be best if you have Delphi&#x27;s source code available to view this unit.  Thank you and good luck!&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;function TPC1Cypher.Code(const I: Integer): Integer;&#xA;    var&#xA;      Dx: Integer;&#xA;      Ax: Integer;&#xA;      Cx: Integer;&#xA;      Bx: Integer;&#xA;      Tmp: Integer;&#xA;    begin&#xA;      Dx := FX1a2 &#x2B; I;&#xA;      Ax := FX1a0[I];&#xA;      Cx := 346;&#xA;      Bx := 20021;&#xA;      Tmp := Ax;&#xA;      Ax := FSi;&#xA;      FSi := Tmp;&#xA;      Tmp := Ax;&#xA;      Ax := Dx;&#xA;      Dx := Tmp;&#xA;      if Ax &amp;lt;&amp;gt; 0 then&#xA;        Ax := Ax * Bx;  &amp;lt;==== this causes overflow crashing the app&#xA;      Tmp := Ax;&#xA;      Ax := Cx;&#xA;      Cx := Tmp;&#xA;      if Ax &amp;lt;&amp;gt; 0 then&#xA;        begin&#xA;          Ax := Ax * FSi;&#xA;          Cx := Cx &#x2B; Ax;&#xA;        end;&#xA;      Tmp := Ax;&#xA;      Ax := FSi;&#xA;      FSi := Tmp;&#xA;      Ax := Ax * Bx;&#xA;      Dx := Dx &#x2B; Cx;&#xA;      IncrAfter(Ax);&#xA;      FX1a2 := Dx;&#xA;      FX1a0[I] := Ax;&#xA;      Result := Ax xor Dx;&#xA;    end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;After further work, I have the following:&lt;/p&gt;&#xA;&lt;p&gt;Integer overflow is occurring in&lt;/p&gt;&#xA;&lt;pre class=&quot;lang-pascal prettyprint-override&quot;&gt;&lt;code&gt;  unit Data.DBXEncryption&#xA;  function TPC1Cypher.Code(const I: Integer): Integer; &#xA; &#xA;  // lines (as above)..&#xA;&#xA;  if Ax &amp;lt;&amp;gt; 0 then&#xA;    Ax := Ax * Bx;  &amp;lt;==== overflow exception raised in main app, NOT in simple app.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The TSQLConnection component is generating an integer overflow error in the above module and code when setting the SQLConnection connected property to True.&lt;/p&gt;&#xA;&lt;p&gt;To verify the error, I created a small simple app that makes the same calls as my main app.&lt;/p&gt;&#xA;&lt;p&gt;I verified the SQLConnection properties and parameters between the simple app and the main app are identical.&lt;/p&gt;&#xA;&lt;p&gt;This simple app runs without error.  I checked its project options and Overflow checking was off.&lt;/p&gt;&#xA;&lt;p&gt;Now I checked the project options for my main app and found Overflow checking was true, or on.&lt;/p&gt;&#xA;&lt;p&gt;So naturally I thought this was the issue, so I set this to off (false)&lt;/p&gt;&#xA;&lt;p&gt;Ran my main app with this option change, and I still received the Integer overflow error!&lt;/p&gt;&#xA;&lt;p&gt;Stepping through the code of the simple app, execution continues through the line noted above without error, Ax := Ax * Bx.&lt;/p&gt;&#xA;&lt;p&gt;Stepping through the code of the main app, execution is aborted at the line &lt;code&gt;Ax := Ax * Bx&lt;/code&gt; with overflow error.&lt;/p&gt;&#xA;&lt;p&gt;So now I added the directive &lt;code&gt;{$Q}&lt;/code&gt; to my main app and still get the overflow error.&#xA;I&#x27;ve searched my files, and nowhere do I see an option to set overflow checking on other than in Project Options, where it is now off.&lt;/p&gt;&#xA;&lt;p&gt;I&#x27;m baffled.&lt;/p&gt;&#xA;
        </summary>
    </entry>
</feed>