Using environmental variables to get full path-names
Posted on 2000-02-14
I'm writing code which is designed to read a server name , which is a key-value in an INI file, and then use this to connect the PC running my application to this server.
To do this, I'm using the API function "GetPrivateProfileString" which works fine when I feed it the full path-name of my INI file. Unfortunately, when I release the software the pathname could be anywhere and is defined by the environmental variable "ServNme" - can I use "ServNme" as the "File" parameter in "GetPrivateProfileString" and if so what is the sytax please? Alternativey, is there any way I can find out the definition of "ServNme" on a PC and then plug the full path-name into "GetPrivateProfileString"?