Jump to content

David Heffernan

Members
  • Content Count

    3701
  • Joined

  • Last visited

  • Days Won

    185

Everything posted by David Heffernan

  1. Class constructors are called from the initialization section of the unit where the class is declared. So in your scenario it depends on the initialization order, and therefore it is not guaranteed that the class constructor is called before class methods are called.
  2. David Heffernan

    Open PDF File

    Why is this so hard?
  3. David Heffernan

    Open PDF File

    This is simply not true. If depends entirely on how the file association has been registered. Which depends on which program is controlling that association. Easy to imagine that UltraHyperMegaPDF might do it differently from other programs.
  4. David Heffernan

    Open PDF File

    My advice is to show your code, a complete program, a console app say. This will include the call to CreateProcess or ShellExecuteEx. With the full path to the executable. And with error checking code included.
  5. David Heffernan

    Open PDF File

    Is that true? Doesn't double click in explorer map to the default verb, which may not be open.
  6. David Heffernan

    Open PDF File

    If you are going to start a new process, as your code does here, then you should use CreateProcess. ShellExecute is for invoking shell verbs. I mean, it will start new processes, but if you know you want to start a new process, you may as well do so rather than get a third party to do it. If you are going to invoke a shell verb you should always use ShellExecuteEx. ShellExecute has been obsolete for over 20 years now. The primary benefit of ShellExecuteEx is that it handles errors in a rational manner. As for your issue, perhaps it's just that AcroRd32.exe can't be found. What happens when you supply a complete path?
  7. Sure. I just read your very first post and my initial reaction was that you'd changed two things and the OP may have got the wrong impression that both were needed to resolve the compilation error.
  8. The generic code doesn't refer to any methods, not that the interface even has a hy methods here.
  9. I don't understand why you would use TMyList<T:IMyIntf> rather than TMyList<T> here
  10. David Heffernan

    Anybody changing FileVersion directly in dproj file?

    For releases, do you build from the IDE?
  11. David Heffernan

    How to use unit BufferedFileStream & FastCopy?

    It's impossible to say that SSD is too expensive. It depends entirely on the usage. SSD suits usage that favours speed over volume. HDD is more suited to usage that favours volume over speed.
  12. David Heffernan

    How to use unit BufferedFileStream & FastCopy?

    Nothing you have described here goes anyvway to achieving that. No, because it's not useful for the problem that you are trying to solve. Avtually I suspect you are solving the wrong problem. My advice is that you elaborate on the problem you face rather than talking about potential solutions.
  13. David Heffernan

    How to use unit BufferedFileStream & FastCopy?

    What's wrong with asking the system to copy a file? 100% you should not be using this buffered file stream code.
  14. Well, sometimes I think people say things that aren't correct. And I have had that thought multiple times.
  15. Nah, I don't really believe anything that you are saying here.
  16. That's implausible. If you start changing executable and dll filenames then the program will just stop working.
  17. David Heffernan

    What it's like to be a Delphi Developer

    What’s the worst thing about being a developer? Working in that “other” IDE (of course)! That is the part I was referring to.
  18. David Heffernan

    What it's like to be a Delphi Developer

    I love the parts where he says RAD Studio is awesome and Visual Studio is terrible.
  19. David Heffernan

    10.4.1+ Custom Managed Records usable?

    Correct. But there are many possible ternary operators. It's the conditional operator, which is an example of a ternary operator.
  20. David Heffernan

    10.4.1+ Custom Managed Records usable?

    We should stop referring to the conditional operator as "the" ternary operator. A ternary operator is one with three operands. Just as a binary operator is one with two operands.
  21. David Heffernan

    Prevent OnClick to be handled twice

    Oh, I am confused. You said you don't want it to run twice.
  22. David Heffernan

    Handlin the message and returning value to the caller

    The sender of the message will receive the return value that you set. Perhaps a bigger problem is that vcl window recreation means that your form's window handle is liable to change during its lifetime. For ipc using windows messages you need to use stable window handles.
  23. David Heffernan

    Prevent OnClick to be handled twice

    Set OnClick to nil in the event handler and leave it as nil until the program terminates. Then the event handler can never run again. I presume that you want the event to run no more than once during the life of the process. Or is that assumption incorrect.
  24. Correct. And as a developer that does a lot of parsing of scientific / engineering data, I just don't recognise the issue of dealing with thousand seperators. In the data that I process, they just don't appear. You don't bother trying to strip them, you just require the data not to have them. Exactly. It's a mugs game trying to handle data whose formatting is ambiguous, so don't do it.
  25. Seriously veering off topic here. Date strings don't go through StrToFloat.
×