Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, Ayumi), 702 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | chip programmers | 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