Jump to content

Der schöne Günther

Members
  • Content Count

    651
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by Der schöne Günther

  1. Not trying to be a smartass, but doesn't the compiler warn you explicitly? Like
  2. Der schöne Günther

    How can I create a smith chart in c++ Builder 11.3 Alexandria

    I am not familiar with that kind of chart, but TeeChart for VCL has it. smith.png (919×526) (steema.com) You will need to acquire the Pro version. Steema | Feature Matrix TeeChart VCL / FMX
  3. Consider this complete VCL application (Form1 & Button1): unit Unit1; interface uses System.SysUtils, System.Classes, Vcl.Forms, Vcl.StdCtrls, Vcl.Controls; type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); end; var Form1: TForm1; implementation {$R *.dfm} procedure causeStackOverflow(); begin causeStackOverflow(); end; procedure TForm1.Button1Click(Sender: TObject); begin causeStackOverflow(); end; end. Clicking the button causes the application to hang for a bit, then the debugger will break on a EStackOverflow exception. That's totally expected. But directly after that, the application tries to display its regular error dialog, causing an access violation and then silently crashing. This is the callstack: It will then cause an access violation in user32.dll repeatedly and then crash. I have no idea why. 64 Bit is fine, by the way. It just happens with 32 Bit .exe.
  4. Der schöne Günther

    Why does a stack overflow cause a VCL application to terminate?

    Good catch, it does. Absolutely, but I expected it to recover from it by popping the stack to the next exception handler and proceeding as usual. Does that mean a stack overflow in the main thread should generally be seen as non-recoverable and game over?
  5. Why? I think that is actually a pretty decent way.
  6. Der schöne Günther

    MacOs Ventura and NaN

    Sounds like this here to me: https://quality.embarcadero.com/browse/RSP-40939
  7. Der schöne Günther

    TWebBrowser: Remove Scrollbars not working

    You need to get familiar with how TWebBrowser works. It can either use Internet Explorer or Microsofts Chromium-based "WebView2" runtime, if it is installed and your application has the "WebView2Loader.dll" in its path. If you are using Internet Explorer mode (and probably running in IE 7 mode), then you are correct, it will still show vertical scrollbars although the CSS says otherwise. In that case (if you really want to stick with the old Internet Explorer mode), you will need the non-html conforming <body scroll="no"> which Internet Explorer will understand:
  8. Der schöne Günther

    Set pipeline between UI and cmd.exe

    Many thanks, that ist most helpful. I'll give it a read. I remember a system completely hanging up because one process had hundred thousands of handles it didn't close properly, then spawning a child process and trying to inherit all handles to it.
  9. Der schöne Günther

    Set pipeline between UI and cmd.exe

    A ready to use solution (which I have never tried) is TurboPack/DOSCommand: This component let you execute a dos program (exe, com or batch file) and catch the ouput in order to put it in a memo or in a listbox. (github.com) It is said to be available throught "GetIt" as well. For myself, I did it as also suggested by this fine gentleman here For the processes I spawn myself (via CreateProcess()), I just create two pipes and then use WriteFile(..) and ReadFile(..) on them. It is important that CreateProcess(..) has its "inherit handles" parameter to true. If you're stuck, I might post my solution, but it contains a a lot of noise as well (such as moving the created process to a "job object" to allow easier resource scheduling or termination)
  10. Der schöne Günther

    Set pipeline between UI and cmd.exe

    There is plenty of examples on how to do this with Delphi, you already got the correct term: It's (inter-process) communication (IPC) via "pipes". I'd recommend to start a bit more humble by making a small console app by yourself that will, for example, take two numbers from the input, and return the sum of these two numbers. Then, try sending these two numbers to your console app and getting the result back. If that works, you can do that with your free pascal compiler. By the way: Cmd.exe is nothing more than a front-end that just does what your application wants to do. You don't need to "connect" to a cmd.exe. You will directly launch and communicate with your free pascal compiler.
  11. Der schöne Günther

    Working with PDF files??

    So what? Also, the web browser for "surfing the internet" got nothing to do with how you want to display PDF files within your application. You should get familiar with the WebView2 runtime for your trusty old TWebBrowser. I'd strongly recommend.
  12. Der schöne Günther

    Working with PDF files??

    Why don't you just use a WebView to display the PDF? It can enable/disable zoom by gestures/touch/hotkeys, and set the general zoom level, but I think it cannot zoom in on a specific part of the PDF, like you can with two fingers on a touchscreen.
  13. Der schöne Günther

    TWebBrowser: Remove Scrollbars not working

    Instead of these hacks, why don't you just disable scroll bars by CSS?
  14. Der schöne Günther

    NetHTTPClient

    You probably might want to read the "Important note about DLL memory management" you just posted.
  15. Der schöne Günther

    Choosing a Mac

    Thank you for your experience. I couldn't have told.
  16. Der schöne Günther

    Choosing a Mac

    Exactly the same configuration I am also considering. If you have something to share about your experience, please do tell.
  17. Der schöne Günther

    Choosing a Mac

    Can you give a rough estimate what you consider "enough" for both RAM (probably 16+ GB) and disk? I am not familiar with Parallels, and how its VMs tend to grow in size. PS: I found it surprisingly convenient to go the other way: Use the Mac as my main computer and remote into an old PC (hosting my Delphi Hyper-V machines) for doing Delphi stuff.
  18. Der schöne Günther

    Control Edge Downloads via TEdgeBrowser

    Haven't tried to run it, but looks legit to me. You will call add_StateChanged(..) to then monitor for the value to become COREWEBVIEW2_DOWNLOAD_STATE_COMPLETED. Are you using the latest runtime?
  19. Der schöne Günther

    Escaping UK pound sign in JSON

    Don't experiment and then forget about it. Write some proper unit tests so that they will always be with you and your project. 🧐
  20. Der schöne Günther

    Escaping UK pound sign in JSON

    None of this should be necessary. Just using a regular TJsonString outputs {"MyString":"The price is £20.00"} {"MyString":"The price is \u00A320.00"} Check: program Project1; uses System.JSON; var LText, LEscapedText: string; LJsonString: TJsonString; LJsonPair: TJsonPair; LJsonObject: TJsonObject; begin LText := 'The price is £20.00'; LJsonString := TJsonString.Create(LText); // Not your subclass TSvJsonString LJsonPair := TJsonPair.Create('MyString', LJsonString); LJsonObject := TJsonObject.Create(LJsonPair); try LEscapedText := LJsonObject.ToString; WriteLn(LEscapedText); LEscapedText := LJsonObject.ToJSON; WriteLn(LEscapedText); finally LJsonObject.Free; end; ReadLn; end.
  21. Der schöne Günther

    Best Practice Question: Bidirectional EXE-to-EXE communication

    Is there a public documentation how one has to implement "AppTethering" to be compatible? Otherwise, it's another vendor-lockin, and you're stuck with Delphi/C++ Builder for implementing both sides.
  22. Der schöne Günther

    Best Practice Question: Bidirectional EXE-to-EXE communication

    I recently did it to extend a Delphi application. The extension was written in C++ and is a regular console application. The Delphi "master" app launches it, sends it commands via stdin and gets result via stdout. It was super easy to test in isolation with a clients machinery because the console app can also be launched and used by a regular ... console window. Would definitely do so again. Not sure if it's a feasible solution if you need to rapidly exchange gargantuan amounts of data. For that, memory mapped files or sockets are probably a better approach.
  23. Der schöne Günther

    Best Practice Question: Bidirectional EXE-to-EXE communication

    There's tons of different IPC mechanisms. What you need depends on your requirements. If you already have the "logic" part in a separate console application, why don't use its stdin/stdout (which are already pipes)?
  24. That's an interesting approach, never seen it before. 🤔 To this day, I also go with try .. except Rollback; raise; end
  25. Der schöne Günther

    Embarcadero C++ Programmer for Engineering UK

    You have been having a vacant C++ developer position for over two years now? How many applicants did you get so far?
×