"Hi -
I'm experiencing something strange when I call a FileOpenDialog from a
dialog box in my application (Borland C++ 6). Basically, here's
the scenario:
- Open my own child dialog from the main window.
- Click on a "browse" button to open the FileOpen dialog. My dialog
allocates the TData and TFileOpenDialog and then Execute()'s it.
- Select an existing executable (which will not be opened, I'm just
using the FileOpen dialog to get the executable name at this point).
This executable can be anywhere on the disk/disks.
- I add the selected file to a linked list that I maintain.
- I destroy the TData and TFileOpenDialog that were allocated earlier.
- When the user exits out of the dialog box, I save the linked list
to disk.
Here's the strange thing - the list contents aren't getting written to
the disk. I traced through it using the TDebugger, and the file name
is correct, the open succeeds (O_CREAT | O_BINARY ), I get a
file handle, each write returns with the correct number of bytes
written, I close the file. Everything looks great in the debugger.
But when I close down the application, and look at the file that
should have gotten written - it's contents are unchanged.
Here's what makes the strange thing even stranger - If I forgo using
the FileOpen dialog in my dialog box and just type in the path to the
file that I want to save the name of, the list contents get written
just fine.
Okay - typing all this in, I had an idea of what *might* be going on.
Does the FileOpen dialog change what my program considers the working
directory? The filename specifying the file that I'm writing to isn't
fully path-qualified - it's just the file name. So, is the file that
is getting opened and written to actually in the directory that the
selected executable was selected from.
This has got to be what's going on - but just in case it isn't,
anybody else have any ideas?
Thanks,
Kevin "
I have this same problem like he had, I sent to him an E-mail he
didn`t answer so do anybody know solution of this problem??
Thanks,
A_Rybicki