Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
PrfQueryProfileInt (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_WINSHELLDATA
SHORT PrfQueryProfileInt(hini, pszAppName, pszKeyName, sError)
HINI hini; /* initialization-file handle */
PSZ pszAppName; /* pointer to application name */
PSZ pszKeyName; /* pointer to keyname */
SHORT sError; /* value returned if keyname not found */
The PrfQueryProfileInt function retrieves an integer from the profile file.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hini Identifies the file to query. This parameter can be a file
handle obtained with PrfOpenProfile or one of the following
values:
Value Meaning
────────────────────────────────────────────────────────────────
HINI_USERPROFILE Search only the user profile.
HINI_SYSTEMPROFILE Search only the system profile.
pszAppName Points to the null-terminated string that contains the
application name. The string must be less than 1024 bytes long,
including the terminating null character. The application name
is case-sensitive.
pszKeyName Points to the null-terminated string that contains the keyname.
The string must be less than 1024 bytes long, including the
terminating null character. The keyname is case-sensitive.
sError Specifies the error value returned if the keyname specified by
the pszKeyName parameter cannot be found.
Return Value
The return value is the integer representation of the text string. If the
keyname cannot be found, the return value is the error value specified by
the sError parameter.
Errors
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
PMERR_INVALID_PARM
PMERR_MEMORY_ALLOC
PMERR_MEMORY_ALLOCATION_ERR
PMERR_MEMORY_DEALLOCATION_ERR
PMERR_NOT_IN_IDX
Comments
The location of the integer is determined by the application name and
keyname passed to this function. The PrfWriteProfileString function must
have been used previously to store the integer as a string. For example, a
string stored as "123" would be returned as the integer 123. The string may
contain a leading minus sign if the number is negative.
See Also
PrfQueryProfileData, PrfWriteProfileString, WinQueryProfileInt
♦