Strange one. Now I have been using TOpenDialog since Delphi 1, now I have an app where when OpenDialog1.Execute is called (or TFileOpen action is used) the dialog doesn't open, in fact it just hangs.

Strange one. Now I have been using TOpenDialog since Delphi 1, now I have an app where when OpenDialog1.Execute is called (or TFileOpen action is used) the dialog doesn't open, in fact it just hangs.

Can't recreate it in a sample app and seems to work elsewhere ok.

VCL, Seattle, Windows 10

Any ideas?

Thanks

Comments

  1. In past I had the similar issue when directory name is not exist. Or network drive is not found (do not remember details now).

    ReplyDelete
  2. Do you have the call stack for the hang?

    Is this on a customer's machine only? It could possibly be an Explorer extension.

    ReplyDelete
  3. Create a minimal reproduction. Debugging 101.

    ReplyDelete
  4. Oftentimes it's a default directory on a network share, as have been mentioned. Considering all the different setups out there (i mean the dialog can open a WevDAV server site even (!!)) the fact it hangs is not strange. I have my shell / Explorer hanging every now and then w/o the help of Delphi.

    ReplyDelete
  5. Sounds like a memory problem to me. I presume you are using OpenDialog statically. You may have corruption in the object data. Check all the events, especially on OnShow to ensure they are nil.

    Is it a 32-bit program running in 64-bit Windows? Open dialog creates several threads upon invocation (execute) and can use quite a bit of memory depending on what's in its object structure.

    If you are low on memory or the heap is sufficiently fragmented open/save dialog may fail.

    ReplyDelete
  6. COM initialisation and multi-threading issues come to mind. A small reproducible case should put you in the right direction.

    ReplyDelete
  7. Tip: break in the debugger when that happens. Check the call stack of the main thread. Get back with a stack dump.

    ReplyDelete
  8. I've tried to create a minimal example and I can't create the issue. Multiple other applications work with this on the same computer.So it looks like something in the application is causing a problem. Seeing the thread comment makes me think as there is a bit of threading in the app. I'll take a look there.

    ReplyDelete

Post a Comment