|
Can 3dgs read from and write to %appdata%?
#334501
07/23/10 18:06
07/23/10 18:06
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
We're having the Problem that our game, once installed, won't run on win7 and Vista, seemingly because of administrative rights. We need to write and modify files in the folders. The manual entry on "save_dir" says to change the dir on windows vista. Now we want to change the dir where everything is saved to the application data, since that's what it's for. Can 3dgs somehow access the %appdata% variable at runtime without any plugins?
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Can 3dgs read from and write to %appdata%?
[Re: DJBMASTER]
#334511
07/23/10 18:37
07/23/10 18:37
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Uh, yes. Exactly. Thanks... How do I access that function in LiteC though? This gives me a syntax error: HRESULT WINAPI SHGetFolderPath(HWND hwndOwner, int nFolder,HANDLE hToken,DWORD dwFlags,LPTSTR pszPath); #define PRAGMA_API SHGetFolderPath;Shell32.dll!SHGetFolderPath
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Can 3dgs read from and write to %appdata%?
[Re: Joey]
#334531
07/23/10 19:46
07/23/10 19:46
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
#include <acknex.h>
#include <default.c>
#include <windows.h>
HRESULT WINAPI SHGetFolderPath(HWND hwndOwner, int nFolder,HANDLE hToken,DWORD dwFlags,char* pszPath);
#define PRAGMA_API SHGetFolderPath;Shell32.dll!SHGetFolderPathA
const int APPDATA = 0x001A;
char buffer[260];
void main()
{
SHGetFolderPath(NULL,APPDATA,0,NULL,buffer);
error(buffer);
}
|
|
|
Re: Can 3dgs read from and write to %appdata%?
[Re: DJBMASTER]
#334542
07/23/10 20:29
07/23/10 20:29
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Perfect. Thank you very much. I didn't convert LPTSTR into a char* pointer... and SHGetFolderPathA was the other Rroblem. So 0x001A is the value of CSIDL_APPDATA? interesting...
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
|