FileOpenDialog - problem with writting

Discussion in 'C++' started by, Jan 15, 2005.

  1. Guest

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

    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??

    , Jan 15, 2005
    1. Advertisements

  2. Jack Klein

    Jack Klein Guest

    On 15 Jan 2005 15:44:33 -0800,
    () wrote in comp.lang.c++:

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


    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
    news:borland.public.* family, but they only accept posts directly to
    their own server,, 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

    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    Jack Klein, Jan 16, 2005
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anita C


    Anita C, Dec 2, 2003, in forum: ASP .Net
    S. Justin Gengo
    Dec 2, 2003
  2. Hai Nguyen
    Hai Nguyen
    Feb 26, 2004
  3. MJK
    Lionel B
    Nov 21, 2008
  4. JMMB

    Security problem when writting to Event Log

    JMMB, May 19, 2005, in forum: ASP .Net Security
    Nicole Calinoiu
    May 19, 2005
  5. Erwan Loisant

    Problem writting bindings

    Erwan Loisant, Oct 22, 2004, in forum: Ruby
    Erwan Loisant
    Oct 22, 2004

Share This Page