FileOpenDialog - problem with writting

A

a_rybicki

"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
 
J

Jack Klein

"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:

[snip]

Wrong newsgroup. None of this is part of the C++ language, it is all
Windows API and compiler library extensions.

You need to post in one of Borland's support groups in the
family, but they only accept posts directly to
their own server, nntp:newsgroups.borland.com, so you'll have to use a
real newsreader, or try their web based interface somewhere on their
web site.

Alternatively, you might try a generic Windows programming group like
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top