Jump to content

Lars Fosdal

Administrators
  • Content Count

    3565
  • Joined

  • Last visited

  • Days Won

    120

Everything posted by Lars Fosdal

  1. Any chance of adding IBM MQ to the list of MQs? See also: https://developer.ibm.com/articles/mq-downloads/
  2. Lars Fosdal

    Need suggestion on developing a custom component

    TMS has some pretty powerful and flexible grids - and you can have controls in grid cells, but for something like you suggest, you'd have to do some creative programming. https://www.tmssoftware.com/site/tmsvcluipack.asp https://www.tmssoftware.com/site/advgrid.asp What you could do, in theory, is to use several TGridPanels and splitters - but yeah - it depends on the functionality you require to be grid-like.
  3. Lars Fosdal

    Build / Output messages filtering plugin

    Just jotting down what my brain generates - what if... - Each hint warning could display the last git username that touched the file - If the file is changed but not committed, it would be your name - A filter could be added to highlight messages for specific username(s) and/or unit names - or hide messages not matching the filter
  4. Lars Fosdal

    Return an array from a function??

    You could also do something like this, which gives you the results converted to actual types instead of variants.
  5. Lars Fosdal

    Build / Output messages filtering plugin

    Not that I know of. I am on my team like a hawk to have them clean up code that generates hints and warnings before they commit, so usually what I see is mine. But - it could be useful. Perhaps @dummzeuch has something up his sleeve?
  6. Lars Fosdal

    Build / Output messages filtering plugin

    When you say messages - do you mean hints and warnings? (IMO, Hints and warnings are bugs waiting to happen and needs to be fixed on sight)
  7. Such systems usually requires large amounts of updates because of adaptations to national regulations, rates, tax law and other legislation that can be changed several times per year. I guess that is not the case for BS1.
  8. Lars Fosdal

    take a look to this REST API Server

    Still wondering WHY I should spend time looking at it?
  9. Lars Fosdal

    Caching oddity

    How do you open the files with regards to sharing?
  10. Lars Fosdal

    Binary size, how-to make it smaller?

    Ok, that explains it until the next time I've forgotten about it. Thanks, @Dalija Prasnikar 🙂
  11. Lars Fosdal

    Binary size, how-to make it smaller?

    I agree. They are the bread and butter of most apps. Still, it makes you wonder why the linker cannot eliminate more of the unused stuff.
  12. Lars Fosdal

    Apache Module with TDataSet Needs Wait Cursor

    Can it be reproduced in a miniature example, using only direct FireDAC calls? Are you sure there is no exception handling or error eating inside your library routines?
  13. Lars Fosdal

    Binary size, how-to make it smaller?

    Turn off RTTI if you can.
  14. Lars Fosdal

    Apache Module with TDataSet Needs Wait Cursor

    If you explicitly - without conditions - use the FireDAC.ConsoleUI.Wait unit in the project: Can you describe any errors you may get? If no errors - can you identify which call that fail? The connect or the query?
  15. Lars Fosdal

    Apache Module with TDataSet Needs Wait Cursor

    What happens if you include the console version unconditionally?
  16. Lars Fosdal

    Apache Module with TDataSet Needs Wait Cursor

    Have you tried adding this to your uses clause? {$ifdef Console} FireDAC.ConsoleUI.Wait, {$else} FireDAC.FMXUI.Wait, FireDAC.Comp.UI, {$endif}
  17. My workaround for generic classes is a non-generic base class. The challenge is always how to wrap stuff in such a way that you can get done what you need get done with the methods and properties defined in the abstract base class. I.e. Keep the T stuff out of the methods as far as possible. Rough example... type TxQuery = class abstract protected function GetSQL: TStrings; virtual; abstract; function GetDataSet: TDataSet; virtual; abstract; public constructor Create; virtual; // doesn't really need to do anything but exist procedure Execute; virtual; abstract; property SQL: TStrings read GetSQL; property DataSet: TDataSet read GetDataSet; end; TxQuery<T: TFDDataSet> = class(TxQuery) private FiQuery: T; protected // overrides property iQuery: T read FiQuery write FiQuery; public // overrides constructor Create; override; // initialize the T stuff end; TxQueryClass = class of TxQuery;
  18. Lars Fosdal

    OmniPascal: Auto-Implementation of methods not working

    Perhaps file an issue here: https://bitbucket.org/Wosi/omnipascalissues/issues
  19. BTW: Did you try CopyFileEx? https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-copyfileexa
  20. DoCopy calls WinAPI.Windows function CopyFile; external kernelbase name 'CopyFileW'; So, your guess is good as mine...
  21. The silent flag for the shell copy makes it run nicely in services and console apps - but yeah... no progress callback. LOL at the last comment 😄
  22. Edit: Doh - as always I misread the original post... You wanted a callback for progress, I offered a progress bar 😛 Off to top up the coffee mug... I use the native Windows one. It deals well with UNC paths, access rights, network glitches, etc. In addition, I touch up the target file date to ensure it matches the original file date. Code was yanked from a utility unit, so there may be missing or superfluous units or functions. uses System.SysUtils, WinAPI.Windows, WinAPI.mmSystem, Winapi.ShlObj, Winapi.ShellApi, Winapi.ShFolder; function ShellFileOperation(const hHandle: THandle; const aSourceFiles: string; aTargetDirectory: string; aFunc:UInt; aFlags: FileOp_Flags; ProgressText:String):Integer; var shellinfo: TSHFileOpStruct; rc: Integer; begin FillChar(ShellInfo, SizeOf(ShellInfo), 0); shellinfo.wnd := hHandle; shellinfo.wFunc := aFunc; shellinfo.fFlags := aFlags; shellinfo.pFrom := PChar(aSourceFiles+#0); shellinfo.pTo := PChar(aTargetDirectory+#0); if ProgressText <> '' then shellinfo.lpszProgressTitle := pChar(ProgressText) else Shellinfo.lpszProgressTitle := pChar('Copying'); rc := SHFileOperation(shellinfo); if (rc = 0) and shellinfo.fAnyOperationsAborted then rc := -1; Result := rc; end; function FileCopyProgress(const SourceFile, TargetFile: String; const ProgressText: String; const AppWinHandle: THandle; const Silent:Boolean): Boolean; var rc : Integer; Flags: UInt; aDate: TDateTime; awh: hWnd; begin FileAge(SourceFile,aDate); Flags := FOF_NOCONFIRMATION OR FOF_FILESONLY OR FOF_ALLOWUNDO; if Silent then begin Flags := Flags OR FOF_SILENT OR FOF_NOERRORUI OR FOF_NOCONFIRMMKDIR; awh := 0; end else awh := hWnd(AppWinHandle); rc := ShellFileOperation(awh, SourceFile, TargetFile, FO_COPY, Flags, ProgressText); DebugOut('ShellFileCopy ' + SourceFile + ' -> ' + TargetFile + ' returns rc='+IntToStr(rc)); Result := (rc = 0); if Result then begin Sleep(250); FileSetDate(TargetFile, DateTimeToFileDate(aDate)); end; end;
  23. Interesting read. About avoiding RTTI as much as possible - how is this achieved? Edit: Or rather - what tradeoffs were necessary to eliminate the RTTI dependencies?
  24. Isn't that basically the same message as the one that Herb Sutter presented years ago (2007)? “Machine Architecture: Things Your Programming Language Never Told You” Slides: https://nwcpp.org/talks/2007/Machine_Architecture_-_NWCPP.pdf
×