13.07.2015 Views

REFERENCE GUIDE

REFERENCE GUIDE

REFERENCE GUIDE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GetProfileStringThis function copies a character string from the Windows initializationfile, WIN.INI, into the buffer pointed to by the IpReturnedString parameter.The function searches WIN.INI for a key that matches the name specifiedby the IpKeyName parameter under the application heading specified bythe IpAppName parameter. If the key is found, the corresponding string iscopied to the buffer. If the key does not exist, the default character stringspecified by the IpDefault parameter is copied. A string entry in WIN.INImust have the following form:[application name]keyname = valueIf IpKeyName is NULL, the GetProfileString function enumerates all keynames associated with IpAppName by filling the location pointed to byIpReturnedString with a list of key names (not values). Each key name inthe list is terminated with a null character.Parameters IpAppName LPSTR Points to a null-terminated character string thatnames the application.Return valueCommentsIpKeyNameIpDefaultIpReturnedStringnSizeLPSTR Points to a null-terminated character string thatnames a key.LPSTR Specifies the default value for the given key ifthe key cannot be found in the initialization file.LPSTR Points to the buffer that receives the characterstring.int Specifies the number of characters (including thelast null character) that will be copied to the buffer.The return value specifies the number of characters copied to the bufferidentified by the IpReturnedString parameter, not including theterminating null character. If the buffer is not large enough to contain theentire string and IpKeyName is not NULL, the return value is equal to thelength specified by the nSize parameter. If the buffer is not large enough tocontain the entire string and IpKeyName is NULL, the return value is equalto the length specified by the nSize parameter minus 2.GetProfileString is not case-dependent, so the strings in IpAppName andIpKeyName may be in any combination of uppercase and lowercase letters.Chapter 4, Functions directory 339

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!