Valhalla Legends Forums Archive | C/C++ Programming | Directory Problems

AuthorMessageTime
Mephisto
Which functions in the Win32 API (or functions at all) cause the directory a program looks in to be changed to the default directory?
December 19, 2004, 2:57 AM
Myndfyr
Can you be more specific?  I'm not entirely sure that your question was coherent (or maybe I'm incoherent this time of night), but can you describe what problems you are experiencing or what effect you are trying to reproduce?
December 19, 2004, 9:15 AM
Zakath
The default system directory can be found with %systemroot%. Is that what you're looking for?
December 19, 2004, 4:20 PM
St0rm.iD
chdir?
December 19, 2004, 4:47 PM
Arta
I think he means, which API can change the default directory.
December 19, 2004, 5:02 PM
Mephisto
The problem is that after my bot loads for about ~20 minutes depending possibly on wha the channel conditions are it gives me a failure to load configuration error whenever it tries to load the file again.  I have no idea why either, and the only thing I can think of is that it's switching the directory somewhere else, but oddly enough everytime I load the configuration I reset the current directory back to the one the exe is in (where the configuration is).  The reason I asked is because Arta had these problems one time as well, and suggested it might be an API call switching the directory on you or something.

Anyways, I'll look into it more and try to do some more debugging and ask more specific questions if I have any problems.
December 19, 2004, 5:07 PM
Arta
I actually kind've doubt that it is that now. I just remembered that I had that problem in Delphi with a VCL control, so it's unlikely to be affecting you :)

I'd check to make sure your that file class you wrote is tidying up properly. Are you making a new instance of the class each time you load the file? If not, make sure all your functions tidy up after themselves -- don't leave the destructor to do all that if it's not being used.
December 19, 2004, 7:56 PM

Search