Jump to content

David Heffernan

Members
  • Content Count

    3711
  • Joined

  • Last visited

  • Days Won

    185

Posts posted by David Heffernan


  1. 20 minutes ago, Mike Torrettinni said:

    Certainly a valid point, but my users already get a message showing success. Now they will get more useful one. Actually, I think I will add user setting 'Don't show file confirmation message' or similar and that should be useful. I hope this satisfies both user types.

    Much more valuable is not to show any dialog at all and not to ask them to make a choice about whether they want to see it, and just have the program do the right thing.

    • Like 2
    • Thanks 1

  2. You can read the C standard to find out how it handles that enum. Then double check with a compiler.

     

    I mean you surely aren't going to commit this without double checking with a C compiler? 


  3. 56 minutes ago, PeterBelow said:

    If you execute the TParallel.For loop in the main thread then it would probably block the Synchronize call, since that tries to execute code in the main thread. The code can only be executed when the main thread reaches a "safe" state, which, in a typical VCL application, is the message loop. Your code does not get there until the complete loop has been finished.

     

    What you need here is a thread-safe stack class, or you have to use a standard TStack<T> in a thread-safe manner, i. e. use a TCriticalSection object, which you enter before each pop or push call on the stack and leave when the call has returned (using try finally!). The loop will still block your main thread until it is done, though.

    So TParallel doesn't service the synchronize queue?


  4. The reason you don't call FileExists is that CreateFile will fail and GetLastError will tell you that the file does not exist.

     

    You have tell us why you believe that CreateFile should fail in the scenario that concerns you. Another program already opened the file? With what flags? 

     

    Rather than have us spend time trying to guess how to recreate the problem, can you provide a complete console app that reproduces the issue. 


  5. Why do you call FileExists? A single call to CreateFile can tell you what you need. The code as it stands won't tell you whether or not the file is in use. What is hdl? Use THandle as stated above. 

     

    As for the problem, debug it! Use GetLastError if CreateFile fails. If CreateFile succeeds then there's presumably something wrong with your logic. 


  6. 3 hours ago, Mike Torrettinni said:

    I'm not too fond of Vista dialogs, they seem very rigid, not flexible enough to fit in the software design.

    That's an odd comment. For dialogs with a message, and couple of checkboxes or buttons then they are perfectly flexible.

     

    If you want to customise every individual form then what are you even asking? Just design each one in the designer. 


  7. Any developer or organisation that cares about quality should be flexible enough to accept bug reports from a variety of channels.

     

    Clearly if the reporter can enter a high quality report in the project bug tracker, then that is the ideal. But in reality that is not always possible. Sometimes these reports are unclear and imprecise and the project owner has to edit the report.  And sometimes the reporter just won't take the required steps. Sometimes the reporter is stubborn and for inexplicable reasons refuses to give their email address and a password to sourceforge  😉

     

    But what developer would here of a bug in their software and not want to fix it?  Any developer that is prepared to let bugs pass if they aren't in the tracker should just give up.

     

    Incidentally, it grinds my gears that Emba killed QC without transferring open reports to the replacement. On numerous occasions I have been asked by Emba staff to resubmit to QP the litany of open floating point related bugs that I submitted to QC.  It makes no sense to me at all that any developers that care about quality would do that.

    • Like 3
×