Jump to content

Fr0sT.Brutal

Members
  • Content Count

    2268
  • Joined

  • Last visited

  • Days Won

    46

Everything posted by Fr0sT.Brutal

  1. Fr0sT.Brutal

    The software industry has moved to the Web, why?

    I guess the domain is enterprise-level apps residing in LAN and using DB/remote services anyway. Of course, ultimately moving stuff like IDE, notepad or office to 3rd party cloud is pretty bad idea (however, they are nice working in parallel with traditional software)
  2. Fr0sT.Brutal

    VCL - DevExpress

    This one is industry standard
  3. Fr0sT.Brutal

    Writing & Reading as a Console App?

    You can get handles of STDIN/OUT hStdin := GetStdHandle(STD_INPUT_HANDLE); hStdOut := GetStdHandle(STD_OUTPUT_HANDLE); and then call usual Read/WriteFile
  4. While I'm impressed on ChatGPT's abilities to generate mechanic code, this very example is only good for quick MVP and not serious production. Modifying a field requires changes in 3 places. The best option would be universal RTTI-based approach or the class should be generated always based on JSON schema. Anyway it's kind of new generation RAD tool. However, just like with Delphi RAD features, there's a moment when you throw out almost all of them and just create/init components in code 🙂
  5. Fr0sT.Brutal

    The software industry has moved to the Web, why?

    Yes, unbeatable argument. All this mess of multiple OS-dependent builds, OS incompatibility, outdated versions and users that don't want to upgrade because they like everything and the new version is a piece of bell&whistle shit (I am the one!)... Moreover, multi-device adaptation is built-in. All you have to do is check UI on different types of devices and that's all.
  6. Fr0sT.Brutal

    Update an application automatically

    I like W7 much better than W10. For me, W10 just don't have enough sweeties to upgrade. Moreover, in some aspects it is worse
  7. Fr0sT.Brutal

    Need a "Delphi programming guideline"

    Thanks, good to know that. I prefer standardized formats for simple interoperability but likely there are cases where such Delphi-only solutions could win.
  8. First you'll have to wait for those who speak French to understand what the message is
  9. Fr0sT.Brutal

    Memory Leak when loading/unloading Delphi DLL

    Will the bug show when host app is built with Delphi? It would significantly simplify case reproducing
  10. Fr0sT.Brutal

    Need a "Delphi programming guideline"

    Interesting, is it common practice to use Delphi-specific object streaming to store data? What if object structure changes?
  11. Fr0sT.Brutal

    Move objects to a second Data Module

    Don't forget to check if deleted component is referred by other components! On delete these refs just get emptied silently. Form view as text will help on this. Anyway form text view helps much because you can see all non-default properties of a component including event handlers. Then do text search by component name to find all refs
  12. Fr0sT.Brutal

    FTP download file

    ICS has plenty of samples, just look at them.
  13. Fr0sT.Brutal

    How to enter unicode symbols into the Delphi IDE

    If the set of used chars is short, you can use templates as well (built-in RAD ones or from cnPack or other helper wizard).
  14. Fr0sT.Brutal

    Current subscription required to download ?

    ISO's are publicly available via http and ftp though the links are not published officially. However the very situation sucks.
  15. Fr0sT.Brutal

    Update an application automatically

    WinInet InternetGetFile + some custom code for checking version and launching the setup @aehimself also published some code for this IIRC
  16. Fr0sT.Brutal

    Move objects to a second Data Module

    In fact, Delphi teaches us bad things with all this visual & RAD button-dropping. It's good for small apps but when they grow, old habits remain and lead to these nightmare. I was in the same situation with an app started when I started learning Delphi so it's evolving with me. In that app I significantly reduced the number of objects in datamodules by changind all temporary queries (that is, those which do not have any datasource attached) from design-time components to temporary objects created at run-time. Their SQLs are defined as literals in datamodule unit and field list is generated dynamically. And with interface-based wrapper the code is pretty simple with GetTempQuery(Database).Q do begin SQL.Text := SQL_Insert; Params ... ExecSQL; end;
  17. Hmm, probably a file like Packages\CoolLib_DelphiXE-Up_R.dproj would point them to the right idea? Or maybe CoolLib_DelphiXE-UP-TO-ANY-NEWER-FUTURE-OR-PAST-VERSION_R.dproj
  18. Fr0sT.Brutal

    Is there a Delphi equivalent of WriteStr ?

    it has: `%10d` You can borrow the code from GNU Pascal but you'll have to wrap arguments into array. Delphi doesn't support user functions with undefined number of arguments
  19. I'd be happy to know there's no issues but in this case why so many component dev's still maintain personal package files for every supported IDE version?
  20. If only IDE didn't consider these files as its private territory where it could do whatever it wants
  21. So the garbage actually exists (produced by version differences), it's only IDE that does good job upgrading older project files
  22. Many of us miss call stacks in Delphi and have to use heavy or commercial libs. Luckily Microsoft cares of us and provides necessary API's. Here's the unit // Stack tracing with WinAPI // (c) Fr0sT-Brutal // License MIT unit StackTrace; interface {$IFDEF MSWINDOWS} uses Windows, SysUtils; const DBG_STACK_LENGTH = 32; type TDbgInfoStack = array[0..DBG_STACK_LENGTH - 1] of Pointer; PDbgInfoStack = ^TDbgInfoStack; function RtlCaptureStackBackTrace(FramesToSkip: ULONG; FramesToCapture: ULONG; BackTrace: Pointer; BackTraceHash: PULONG): USHORT; stdcall; external 'kernel32.dll'; procedure GetCallStackOS(var Stack: TDbgInfoStack; FramesToSkip: Integer); function CallStackToStr(const Stack: TDbgInfoStack): string; procedure InstallExceptionCallStack; {$ENDIF} implementation {$IFDEF MSWINDOWS} procedure GetCallStackOS(var Stack: TDbgInfoStack; FramesToSkip: Integer); begin ZeroMemory(@Stack, SizeOf(Stack)); RtlCaptureStackBackTrace(FramesToSkip, Length(Stack), @Stack, nil); end; function CallStackToStr(const Stack: TDbgInfoStack): string; var Ptr: Pointer; begin Result := ''; for Ptr in Stack do if Ptr <> nil then Result := Result + sLineBreak + Format('$%p', [Ptr]) else Break; end; function GetExceptionStackInfo(P: PExceptionRecord): Pointer; begin Result := AllocMem(SizeOf(TDbgInfoStack)); GetCallStackOS(PDbgInfoStack(Result)^, 1); // excluding the very function GetCallStackOS end; function GetStackInfoStringProc(Info: Pointer): string; begin Result := CallStackToStr(PDbgInfoStack(Info)^); end; procedure CleanUpStackInfoProc(Info: Pointer); begin Dispose(PDbgInfoStack(Info)); end; procedure InstallExceptionCallStack; begin Exception.GetExceptionStackInfoProc := GetExceptionStackInfo; Exception.GetStackInfoStringProc := GetStackInfoStringProc; Exception.CleanUpStackInfoProc := CleanUpStackInfoProc; end; procedure UninstallExceptionCallStack; begin Exception.GetExceptionStackInfoProc := nil; Exception.GetStackInfoStringProc := nil; Exception.CleanUpStackInfoProc := nil; end; {$ENDIF} end. test project program Project2; {$APPTYPE CONSOLE} {$R *.res} uses Windows, SysUtils, StackTrace in 'StackTrace.pas'; // Demo subs procedure Nested2; begin Abort; end; procedure Nested1; begin Nested2; end; procedure Nested0; begin Nested1; end; begin try InstallExceptionCallStack; Nested0; except on E: Exception do Writeln(E.ClassName, ': ', E.Message, sLineBreak, E.StackTrace); end; Readln; end. and output
  23. Fr0sT.Brutal

    Exception call stacks on Windows with only a few LOCs

    Do you mean you get all the 32 entries of call stack filled? Try to enlarge DBG_STACK_LENGTH then. I don't remember why I chose the value of 32, I've re-read MSDN and saw no limitations on stack size.
  24. Hmm, didn't dproj schema change over compiler versions? It could be hard to downgrade instead of upgrade.
  25. Seems like pretty good lyrics for a new Manowar song 😄
×