473,385 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

FileOpenDialog - problem with writting

"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
Jul 22 '05 #1
1 2295
On 15 Jan 2005 15:44:33 -0800, a_*******@janika.net
(a_*******@janika.net) 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/~a...FAQ-acllc.html
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wayne Gibson | last post by:
Hi all, Please ignore the other post.. The cat jumped on the machine and sent it before I could stop it!! Was wondering if anybody has expericence this problem.. I am writting an application...
7
by: Eran Kampf | last post by:
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath("/")+"test" as the folder) and I am getting a DirectoryNotFoundException saying "Could not find a...
3
by: gregma | last post by:
I hope this hasn't been covered a million times!! I have searched for alternatives to selecting a directory or multiple directories using FileOpenDialog, and haven't found anything like I need. I...
1
by: Anita C | last post by:
I am trying to follow the Ms sample in the .Net SDK/Technologies/Interop/PlatformInvoke/WinAPIs/CS- to click on a button on a webform to bring up the fileopendialog. But it does not seem to work...
2
by: Rams | last post by:
Hi All, iam writting an application which has inkpicture as white board for writting purpose and audio to capture voice. iam saving ink annotations along with its audio time stamp in xml file....
2
by: randy1200 | last post by:
My user interface needs to allow the user to select a default directory. When I say the following: if (openFileDialog1.ShowDialog() == DialogResult.OK) { //record path } The problem here is...
1
by: rahulbsbs | last post by:
Sir how can i get the ip address of the remote system by writting a java code,ie i want to get ip address of the remote system that is connected to my server computer ,the ip address must be...
2
by: Peted | last post by:
Hi is there a way to use the fileopen dialog in c# 2008, so that when i am traversing a directory to find a file to open, if i click on a shortcut to a file or a shortcut to a directory, it will...
0
by: shamshujjuhah | last post by:
I am using the following code to open file. Now I want to position the fileopen dialog to the centre of screen. Can someone tell me how can I acheive this? code: -------------- OpenFileDialog...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.