Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Possible bug. Get off the path to the files.

Author
Message
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 10th Nov 2011 13:05
I'm using C++ in conjunction with AGK. I make a template in the set (VS9). I also use a parser TinyXML. In an attempt to access a file produces an error reading(to xml file). For a long time trying to find bug and as a result discovered that the path to the file then go bad.

I do so


result:


Why did he refer to my documents and whether it can be overcome?
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 10th Nov 2011 13:22
The reason this happens is to ensure compatibility when running on other platforms. If you want to write to the same directory as your executable you can always override this by using GetModulePath and SetCurrentDirectory.
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 10th Nov 2011 13:53
Hmmm, and how to use GetModulePath?
And it does not hurt for cross-platform?
Sharisu
12
Years of Service
User Offline
Joined: 9th Nov 2011
Location: BY, Minsk
Posted: 11th Nov 2011 08:24
Ok, I have everything turned out. Did not even use SetCurrentDirectory. Thank you very much.
But one question remains misunderstood. Cross-platform does not spoil?
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 12th Nov 2011 00:49
The moment you use a proprietary command such as SetCurrentDirectory (i.e. a command not starting with agk: then you are tied to that particular compiler and platform SDK. To keep cross platform universal compatibility, you cannot use 'hacks' such as using SetCurrentDirectory or similar. The reason is that not all platforms would allow you to change your directory.

I drink tea, and in my spare time I write software.

Login to post a reply

Server time is: 2024-03-29 16:02:34
Your offset time is: 2024-03-29 16:02:34