2 registered members (AndrewAMD, Nymphodora),
485
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Write txt in program files, not allowed in vista!
#296777
11/02/09 22:12
11/02/09 22:12
|
Joined: Nov 2003
Posts: 433 The Netherlands
Toon
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2003
Posts: 433
The Netherlands
|
var save_handle;
function save_settings()
{
save_handle = file_open_write("resolution.txt");
file_var_write(save_handle,resolution);
file_close(save_handle);
}
We made a save system in our game based on code like this right up here. We really want to install the game in the program files folder but Vista seems to have a problem with reading and writing files like that in that folder. It says "Empty pointer in"E1415, invalid pointer or handle in". Anyone knows a solution to this?
|
|
|
Re: Write txt in program files, not allowed in vista!
[Re: Toon]
#297322
11/06/09 19:16
11/06/09 19:16
|
Joined: Aug 2005
Posts: 1,185 Ukraine
Lion_Ts
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,185
Ukraine
|
There is nothing to do with that shell variable (prefix) under GS. Actually, you can obtain the value of that variable, but there is more convenient way. Look at SHGetFolderPath. You can call it to obtain the right place to store your data.
|
|
|
Re: Write txt in program files, not allowed in vista!
[Re: Lion_Ts]
#297329
11/06/09 20:12
11/06/09 20:12
|
Joined: Oct 2006
Posts: 470 Balkan
Ganderoleg
Senior Member
|
Senior Member
Joined: Oct 2006
Posts: 470
Balkan
|
Ups this is news to me- I have exactly the same save system as this one My txt files are in the same folder as exe and I had no problem under Xp but haven't test it under Vista. Is there same example in C-Script on how this can be fixed ( I don't really understand how to use information from suggested link (SHGetFolderPath))?
|
|
|
Re: Write txt in program files, not allowed in vista!
[Re: Ganderoleg]
#297340
11/06/09 21:40
11/06/09 21:40
|
Joined: Oct 2004
Posts: 1,655
testDummy
Serious User
|
Serious User
Joined: Oct 2004
Posts: 1,655
|
var save_handle = 0;
function save_settings() {
save_handle = file_open_write("resolution.txt");
if (save_handle == 0) {
error("Hello user. A save system error has occurred.");
error("To resolve this issue, you might try to 'revert' to a 'better' OS or modify user priviledges for folder n.");
error("We recommend that you send a report to Microsoft and then go try to make better use of your time.");
error("Why are you still here?");
return;
}
file_var_write(save_handle,resolution);
file_close(save_handle);
}
Quoting Ganderoleg. Is there same example in C-Script on how this can be fixed... Indeed, that wasn't it. point @ idea fair & obvious = check return value
|
|
|
Re: Write txt in program files, not allowed in vista!
[Re: Lion_Ts]
#297365
11/07/09 00:45
11/07/09 00:45
|
Joined: Oct 2006
Posts: 470 Balkan
Ganderoleg
Senior Member
|
Senior Member
Joined: Oct 2006
Posts: 470
Balkan
|
Thanx for reply. Can way to do this be found in the manual? I have no idea on how to make wrapper dll I am using a small proportion of Lite-C with C-Script in my game but only for PP Effects. They can't share variables as I remember. Can some free dll of this kind be found on the forum? I can't believe that no one needs this feature.
|
|
|
Re: Write txt in program files, not allowed in vista!
[Re: Lion_Ts]
#299760
11/26/09 17:13
11/26/09 17:13
|
Joined: Nov 2003
Posts: 433 The Netherlands
Toon
OP
Senior Member
|
OP
Senior Member
Joined: Nov 2003
Posts: 433
The Netherlands
|
How to create such a dll? I tryed the regular savesystem (gamestudio) as well but also without results. Is there no other way to check for the users paths in c-script? Or perhaps a way to share variables between the two languages? Can anyone tell me how to save files from an .exe that is started in the program files folder on a Vista with c-script...
|
|
|
|