Search code examples
delphicrashfileopendialoghint

opendialog.onhint crash


I have checked 100% I am closing all handles on a file I recently created. But when I call "opendialog.execute;" the dialog pop up as usual but on the mouse over hint of a recently created file the entire thing crashes with a out of bounds error.

I know this is not any of my out of bounds as if I open the file without causing a (onhint) event there is no problem and hardcoding a list of filenames for testing showed that there was nothing wrong with opening or saving a file. Its purely on the onhint event of the open dialog. Like I said if I am quick or I use arrow keys there is nothing wrong with my program.

Whats more interesting is that it doesnt even happen 100% of the time about 70% which has led to me thinking I have fixed it several time if not only for a short amount of time. Does anyone know what could be happening? And if not how can I disable the onhint event?

as aked for the code not that helps at all

OpenDialog.execute;    // crashes here
if fileexists(form1.OpenDialog.FileName) then    
  form1.Address.Text:=form1.OpenDialog.FileName;

and the error link text

EDIT: ok i have some new information a new instance of opendialog still has the same issues. and more interestingly i seem to have solved the 30% issue its on hint of a file with a double tag for example "test.jpg.enc" the thing is its fine with it the first time it runs, and it only crashes on hint of these encoded files, but only if i have encoded that file white the applicatuion has benn open. for example if i encode it,, then try to decode and it crashes.. i can run it again and decode it fine,, but there is no problem with decoding and then encoding in one instance of the aplication.


Solution

  • The solution for this was to use activeX, it appears there was a bug intorduced after SP2

    uses ActiveX;

    initialization OleInitialize(nil);

    finalization OleUninitialize end.

    oringinaly posted by the fox here