delphiaccess-violationsave-dialog

Very strange error in my app from component


Ok my application does everything that is it suppeded to do and it does the same thing every time so its not as if testing was gone be that much trouble.

it crashes "somtimes" not always. it does this when i hover the mouse over a file in the open file dialog i have recently outputted. not instantly it waits about half second to a second, and i know that is when the openfiledialog brings up data such as file size and when it was created and what type of document it is..(standard)mouse hover info.. the thing is this is using the "opendialog" and i didnt write this code so this error is not of my doing is it?????? if it is how,, if it is not how/what can i do to stop it..

the type of error is a "acces violation at address " bla...

the open file dialog has no filters and is exactly as it off compoent tray and it crashes after i call "opendialog.execute"

i initialy thought that it may still be writing to it but then it continued after i stoped the app opening any new file untill the last one had compleated the save process.

as i said it doesnt even happen 100% all the time,, and its not machine specific.. crashes on 3 different win xp pc's.

HELP!!

Additional; findings i can open and run the file and all is well as long as i dont make a hint box to pop up on a file i have created.


Solution

  • Drop an TApplicationEvents component on your form and add an event handler for the OnHint event. Then put a break point in there and see if you can break on that before it crashes (as you said, it sounds like it is crashing when it tries to display the hint). Then you can compile with debug DCU's and trace in and see what it is crashing on.

    My guess is you still have a file handle with an exclusive lock on the file maybe. Check your file handles and make sure you are properly closing them. What happens if you try to open one of those files from notepad while the program is running?

    The intermittent behavior might be related to a different code path on an error condition that leads to a leaked file handle.

    Good luck!