FileOpenDialog - problem with writting

Discussion in 'C++' started by a_rybicki@janika.net, 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?

    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
    , Jan 15, 2005
    #1
    1. Advertising

  2. 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:


    [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
    news:borland.public.* 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
    news:comp.os.ms-windows.programmer.win32.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    Jack Klein, Jan 16, 2005
    #2
    1. Advertising

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

    Fileopendialog

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

    Security problem when writting to Event Log

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

    Problem writting bindings

    Erwan Loisant, Oct 22, 2004, in forum: Ruby
    Replies:
    4
    Views:
    122
    Erwan Loisant
    Oct 22, 2004
Loading...

Share This Page