Skip to main content
GameDev.net gamedev.net
🔒 Locked

really easy question

Started by hello_there Aug 9, 2002 at 6:33 AM 9 replies 250+ views
Original Post
hello_there
hello_there
how do you change the current directory the programe loads from. without doing it when you open the file.
____________How could hell be worse?
Pipo DeClown
Pipo DeClown
huh? you mean when you run the exe, it jumps to another directory? without moving it in windows(thats what i use and i like it)?
hello_there
hello_there
i mean when you run the exe the current directory is the folder where the exe is in. how do you change it?
oh yeah in c++;

[edited by - hello_there on August 9, 2002 7:47:45 AM]

[edited by - hello_there on August 9, 2002 7:48:28 AM]
____________How could hell be worse?
Shag
Shag
_chdir("c:\\temp");
Shag
Shag
CFile::SetFilePath ... in OO!
hello_there
hello_there
does it stay in that directory the rest of the programe?
____________How could hell be worse?
Shag
Shag
yes - unless you change it again,of course!


(PS - programe is spelt program!!! )
hello_there
hello_there
do you need to include something? it want compile
____________How could hell be worse?
Shag
Shag
erm ... try direct.h, off the top of my head.

also - try http://msdn.microsoft.com/library/

and search for file i/o

Regards

[edited by - Shag on August 9, 2002 8:03:55 AM]
hello_there
hello_there
thanks
____________How could hell be worse?
Shag
Shag
you''re welcome!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.