Jump to content

David Heffernan

Members
  • Content Count

    3710
  • Joined

  • Last visited

  • Days Won

    185

Everything posted by David Heffernan

  1. David Heffernan

    Open PDF File

    It's not that people have tweaked the system. They've just chosen to associate the PDF extension with a program that chooses to use different verbs as default. That contradicts your earlier points where you said double click on PDF is the same as invoking open verb.
  2. David Heffernan

    Open PDF File

    It's not pointless. It's really important to know how the system works. These details matter. Details are important when programming. Makes no sense to recommend the 99.99% correct option over the 100% correct option. Obviously it's not likely to go wrong, but once you know how the system works why on earth would anybody opt to make an intentional mistake?
  3. Not necessarily. For instance if your dpr file references them in the other order then it won't be that way. And other unit use clauses can confound you. Enforcing dependencies in initialisation order is not robust. I prefer to find a different way to solve such problems.
  4. David Heffernan

    Get Parent process Current directory

    No. This missing context is the exact reason why this thread has been so long. It's invariably valuable to understand the motivation to a question. It sounds like what you need is for you r the calling processes to provide extra information to your program.
  5. David Heffernan

    Get Parent process Current directory

    Then you are in trouble because there's really no way in general to be sure that the process which created your process still exists when your process executes. Windows has a very different model of parent/child process relationships from say Linux. What problem are you trying to solve?
  6. David Heffernan

    Get Parent process Current directory

    Not if the parent chooses to specify a different current directory. The command interpreter process, which is the parent, might terminate before your process has a chance to inspect it. If you are in charge of creating the process, then pass in the information required as an argument. The more I read of thus the more it seems you are taking the wrong path.
  7. David Heffernan

    Open PDF File

    So you agree with me then.
  8. David Heffernan

    Get Parent process Current directory

    What problem are you trying to solve here, because what you are describing doesn't sound like a robust solution to any problem.
  9. 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.
  10. David Heffernan

    Open PDF File

    Why is this so hard?
  11. 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.
  12. 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.
  13. David Heffernan

    Open PDF File

    Is that true? Doesn't double click in explorer map to the default verb, which may not be open.
  14. 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?
  15. 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.
  16. The generic code doesn't refer to any methods, not that the interface even has a hy methods here.
  17. I don't understand why you would use TMyList<T:IMyIntf> rather than TMyList<T> here
  18. David Heffernan

    Anybody changing FileVersion directly in dproj file?

    For releases, do you build from the IDE?
  19. 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.
  20. 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.
  21. 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.
  22. Well, sometimes I think people say things that aren't correct. And I have had that thought multiple times.
  23. Nah, I don't really believe anything that you are saying here.
  24. That's implausible. If you start changing executable and dll filenames then the program will just stop working.
  25. 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.
×