Does anybody know of a way to use windows variables such as %logonserver% in API calls such as GetPrivateProfileString?
Example: I have a string which points to a .INI file, 'server.ini'. Server.ini is stored on a different server depending on which machine you logged onto, but the path is always the same. The string is therefore:
"%logonserver%\res\server.ini"
Why cant I use GetPrivateProfileString like this:
char filename[256];
DWORD result = GetPrivateProfileString(
"Default",
"Resource file name",
"",
filename,
sizeof(filename),
"%logonserver%\res\server.ini);
The only way I can think of is to strip anything between % and % then use getenv() on that part of the string, is there a simpler way that I have missed????
Help would be most appreciated!!!
Example: I have a string which points to a .INI file, 'server.ini'. Server.ini is stored on a different server depending on which machine you logged onto, but the path is always the same. The string is therefore:
"%logonserver%\res\server.ini"
Why cant I use GetPrivateProfileString like this:
char filename[256];
DWORD result = GetPrivateProfileString(
"Default",
"Resource file name",
"",
filename,
sizeof(filename),
"%logonserver%\res\server.ini);
The only way I can think of is to strip anything between % and % then use getenv() on that part of the string, is there a simpler way that I have missed????
Help would be most appreciated!!!