Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 03/10/25 in all areas

  1. That can be simplified to this: Result := V.IsArray; The ArrayData field is only meaningful for tkArray, it doesn't exist for tkDynArray. For tkDynArray, the ElType field is a member of TTypeData itself. However, it is nil if the array holds an unmanaged type. The actual element type is buried further in the TypeData. The TTypeData record has a DynArrElType() method to fetch it. In both cases, note that the element type is stored as a PPTypeInfo, so you need to dereference it when comparing it to another type. Try something more like this instead: function ValueIsValueArray(const V: TValue): Boolean; // this is pieced together from internal code in System.Rtti.pas... function GetArrayElType: PTypeInfo; var ref: PPTypeInfo; begin Result := nil; case V.Kind of tkArray: ref := V.TypeData^.ArrayData.ElType; tkDynArray: ref := V.TypeData^.DynArrElType; else Exit; end; if ref <> nil then Result := ref^; end; begin Result := V.IsArray and (GetArrayElType() = TypeInfo(TValue)); end;
  2. Anders Melander

    Problem using SpinEditEx in Delphi 12.1

    FWIW, my wife who speaks "human" tells me that my directness was indeed impolite. So sorry, I guess.
  3. Hello Delphi Praxis community, I'm excited to share my new open-source project, AppWatcher: https://github.com/mbaumsti/Delphi-App-Watcher Have you ever faced the challenge of managing dozens of Delphi applications running on multiple network machines? Finding a convenient time window to replace executables can be a real headache. That's why I developed AppWatcher. AppWatcher is a Delphi component and applications that allows you to remotely control the stopping and restarting of your Delphi applications across your network. Here's how it works: Integrate the TAppWatcherClient component into your Delphi applications. Deploy the AppWatcher Agent on your client machines. Use the AppWatcher Master application to remotely control all your applications. Key features: Remotely stop applications with user notifications. Automatically restart applications after updates. Avoid using RDP or physically accessing each machine. Minimize downtime and streamline deployment. If you're looking for a solution to simplify remote application management in your Delphi environment, I encourage you to check out AppWatcher. Contributions and feedback are welcome! Thank you,
  4. Yes, and I've done that as well in some situations but I want the users to run the updated version the next day when they come into the office; if they left it running, they'll still be using the old version still in memory. Of course, I could add something that checks every minute or so and prompts to restart the app or something. Or use this--thanks for the link. So many choices!
  5. Side note: very much off topic: but I love sending postcards and still send about hundred to different friends each year as I travel around.
  6. Maybe such is possible..
  7. Kryvich

    How do I synchronize two TMemo scrolling? [Solved]

    OK, my take. unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TLinkMemo = class(TMemo) private FLinkedMemo: TLinkMemo; procedure SyncLink; protected procedure WndProc(var Message: TMessage); override; public property LinkedMemo: TLinkMemo read FLinkedMemo write FLinkedMemo; end; TMemo = class(TLinkMemo); TForm1 = class(TForm) Memo1: TMemo; Memo2: TMemo; procedure FormCreate(Sender: TObject); private public end; var Form1: TForm1; implementation {$R *.dfm} procedure TLinkMemo.WndProc(var Message: TMessage); begin inherited; if (LinkedMemo = nil) or not LinkedMemo.HandleAllocated then Exit; case Message.Msg of WM_HSCROLL, WM_VSCROLL, WM_KEYDOWN, WM_MOUSEFIRST..WM_MOUSELAST: SyncLink; end; end; procedure TLinkMemo.SyncLink; procedure UpdateScrollBar(BarFlag: Integer; Msg: Cardinal); var scrollInfo: TScrollInfo; begin scrollInfo.cbSize := SizeOf(scrollInfo); scrollInfo.fMask := SIF_POS; if GetScrollInfo(Handle, BarFlag, scrollInfo) then LinkedMemo.Perform(Msg, MAKEWPARAM(SB_THUMBPOSITION, scrollInfo.nPos), 0); end; var savedLink: TLinkMemo; begin savedLink := LinkedMemo.LinkedMemo; try LinkedMemo.LinkedMemo := nil; UpdateScrollBar(SB_HORZ, WM_HSCROLL); UpdateScrollBar(SB_VERT, WM_VSCROLL); finally LinkedMemo.LinkedMemo := savedLink; end; end; procedure TForm1.FormCreate(Sender: TObject); begin Memo1.LinkedMemo := Memo2; Memo2.LinkedMemo := Memo1; end; end.
  8. Sure, I guess that number of XP users are way way way way way way below one can imagine and its not worth it to do a revision just for it. Again, thank you for all your help and still supporting Delphi7 despite it also being so old. side note... ill send postcard when I see one selling in my area.
  9. There are numerous posts on StackOverflow on this topic, most asking why it is not working as expected 😛 Would it be an alternative to open the excel file in excel and use COM to extract the data from Delphi code?
×