TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Sidorsky
from: John Porter
date: 1995-07-22 12:37:00
subject: PrfQueryProfileData()

PAUL SIDORSKY wrote to ALL about PrfQueryProfileData()
and John Porter replied...

PS> I'm using PrfQueryProfileData() to get data from an .INI file.  What I'd like
PS> to know is this:  If the app and/or key names are not found, will
PS> PrfQueryProfileData() modify the data in the buffer passed to it?  I'd like to
PS> be able to initialize the buffer a default value, check for a key, and if it's
PS> not found then carry on with the previously initialized default value.

I think you should try two other functions for what you're trying to
do.  Take a look at...

 /*******************************************/
 /* This function retrieves a string from   */
 /* the specified profile.                  */
 /*******************************************/
 
 #define INCL_WINSHELLDATA   /* Or use INCL_WIN or INCL_PM */
 #include 
 
 HINI   hini;          /* Initialization-file handle */
 PSZ    pszApp;        /* Application name */
 PSZ    pszKey;        /* Key name */
 PSZ    pszDefault;    /* Default string */
 PVOID  pBuffer;       /* Profile string */
 ULONG  cchBufferMax;  /* Maximum string length */
 ULONG  pulLength;     /* String length returned */
 
 pulLength = PrfQueryProfileString(hini,
               pszApp, pszKey, pszDefault,
               pBuffer, cchBufferMax);
 
There is also a simuliar function PrfQueryProfileInt which returns
an integer value.  These both allow for "default" values.
See pszDefault.

The function you are using is more general purpose than I think you
need.

Good luck.

JoRoPo
 h s r
 n s t
 . . e
 . . r

 * KWQ/2 1.2i * Black holes were created when God divided by zero.


--- QScan/PCB v1.16b / 01-0128
* Origin: THE --DETOUR--> BBS 15-Lines 25 GIGS. 609-896-3691 (1:266/159)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 266/159 3615/50 396/1 270/101 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.