Valhalla Legends Archive

Programming => General Programming => C/C++ Programming => Topic started by: Mephisto on December 18, 2004, 08:57 PM

Title: Directory Problems
Post by: Mephisto on December 18, 2004, 08:57 PM
Which functions in the Win32 API (or functions at all) cause the directory a program looks in to be changed to the default directory?
Title: Re: Directory Problems
Post by: MyndFyre on December 19, 2004, 03:15 AM
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?
Title: Re: Directory Problems
Post by: Zakath on December 19, 2004, 10:20 AM
The default system directory can be found with %systemroot%. Is that what you're looking for?
Title: Re: Directory Problems
Post by: Banana fanna fo fanna on December 19, 2004, 10:47 AM
chdir?
Title: Re: Directory Problems
Post by: Arta on December 19, 2004, 11:02 AM
I think he means, which API can change the default directory.
Title: Re: Directory Problems
Post by: Mephisto on December 19, 2004, 11:07 AM
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.
Title: Re: Directory Problems
Post by: Arta on December 19, 2004, 01:56 PM
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.