PrfQueryProfileSize - Example Code

This example calls PrfQueryProfileSize to search the user and system profiles for the value of key "KEY" within the application "APP" and return the byte size of the value if found.

#define INCL_WINSHELLDATA       /* Window Shell functions       */
#include <os2.h>

BOOL  fSuccess;         /* success indicator                    */
HINI  hini;             /* initialization-file handle           */
char  pszApp[10];       /* application name                     */
char  pszKey[10];       /* key name                             */
ULONG pDataLen;         /* data length                          */

/* Both the user profile and system profile are searched */
hini = HINI_PROFILE;

/* specify application and key names */
strcpy(pszApp,"APP");
strcpy(pszKey,"KEY");

fSuccess = PrfQueryProfileSize(hini, pszApp, pszKey, &pDataLen);


[Back: PrfQueryProfileSize - Related Functions]
[Next: PrfQueryProfileSize - Topics]