Gamestudio Links
Zorro Links
Newest Posts
What are you working on?
by rayp. 10/15/25 20:44
Help!
by VoroneTZ. 10/14/25 05:04
Zorro 2.70
by jcl. 10/13/25 09:01
ZorroGPT
by TipmyPip. 10/12/25 13:58
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 10/11/25 18:45
Reality Check results on my strategy
by dBc. 10/11/25 06:15
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 6,732 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joenxxx, Jota, krishna, DrissB, James168
19170 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
GetCurrentDirectory #360129
02/22/11 09:36
02/22/11 09:36
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Have some problems with GetCurrentDirectory, don`t know how to use it (parameters).
I want to get the current directory with it, use file_dialog after what changes the directory and set the directory back with SetCurrentDirectory.

Code:
GetCurrentDirectory(?,?); // i know this is wrong ???
char* my_ent = file_dialog("Load entity","*.tga;*.bmp;*.pcx;*.dds;*.mdl");
SetCurrentDirectory(?);


If i set the directory manually it works:
SetCurrentDirectory("D:\\Dungeon");

Last edited by Widi; 02/22/11 09:36.
Re: GetCurrentDirectory [Re: Widi] #360134
02/22/11 10:25
02/22/11 10:25
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Code:
#define BUFFER_SIZE 2048
	char* chrTemp[BUFFER_SIZE];
	GetCurrentDirectory(BUFFER_SIZE, chrTemp);
	printf(chrTemp);

1st param is the buffer size of the string, change this to whatever, 2nd param is where to store the directory to

hope this helps

Re: GetCurrentDirectory [Re: MrGuest] #360238
02/22/11 21:16
02/22/11 21:16
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline OP
Serious User
Widi  Offline OP
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Works perfect, thanks. I`m not so familar with char.
And another mistake i do was GetCurrentDirectory give only one Backslash return in the path and SetCurrentDirectory needs two. I should use more the printf function to figure someting like this out.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1