c++.windows.32-bits - Setting folders
- Steve (11/11) Jan 16 2004 I'm having some difficulty getting file i/o to work to my satisfaction.
- Bruce Dodson (13/24) Jan 16 2004 For your first question, use GetModuleFilename to figure out
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
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 mysatisfaction.When my program starts up it has to load a few data files.Sometimes when auser starts the program, rather then the program loadingthe files from thesame directory that it resides in, it ends up going to thelast folder theuser accessed. The program then reports an error as itcould not find thefiles! In a similar manner, if the user saves a file allsubsequent loads and saveswill begin at the directory just accessed! Please help, I'm sure there is something very simple thatI am missing.Steve De Chellis www.hmtk.com
Jan 16 2004