www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++.windows.32-bits - Setting folders

↑ ↓ ← "Steve" <steve hmtk.com> writes:
I'm having some difficulty getting file i/o to work to my satisfaction.

When my program starts up it has to load a few data files. Sometimes when a
user starts the program, rather then the program loading the files from the
same directory that it resides in, it ends up going to the last folder the
user accessed. The program then reports an error as it could not find the
files!

In a similar manner, if the user saves a file all subsequent loads and saves
will begin at the directory just accessed!

Please help, I'm sure there is something very simple that I am missing.

Steve De Chellis
www.hmtk.com
Jan 16 2004
↑ ↓ → "Bruce Dodson" <bruce_dodson_except_this_part hotmail.com> writes:
For your first question, use GetModuleFilename to figure out
where your program is.

For your second question, use the lpstrInitialDir field in
your OPENFILENAME structure.



"Steve" <steve hmtk.com> wrote in message
news:bua4ou$2o7m$1 digitaldaemon.com...
 I'm having some difficulty getting file i/o to work to my

 When my program starts up it has to load a few data files.

 user starts the program, rather then the program loading

 same directory that it resides in, it ends up going to the

 user accessed. The program then reports an error as it

 files!

 In a similar manner, if the user saves a file all

 will begin at the directory just accessed!

 Please help, I'm sure there is something very simple that

 Steve De Chellis
 www.hmtk.com

Jan 16 2004