Login   /   Register

Problem - Retrieve all sections from ini file

Rate this article
     2 votes, average: 3.5 out of 52 votes, average: 3.5 out of 52 votes, average: 3.5 out of 52 votes, average: 3.5 out of 52 votes, average: 3.5 out of 5
Loading ... Loading ...
April 1st, 2008 by daniva

API Syntax :

DWORD GetPrivateProfileSectionNames(

LPCTSTR lpszReturnBuffer,

DWORD nSize,

LPCTSTR lpFileName

);

Parameters :

clip_image001 lpszReturnBuffer - [out] buffer that receives the section names associated with the named file. The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character

clip_image001[1] nSize - [in] The size of the buffer pointed to by the lpszReturnBuffer parameter, in characters.

clip_image001[2] lpFileName - [in] The name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.

Return Value : The return value specifies the number of characters copied to the specified buffer, not including the terminating null character. If the buffer is not large enough to contain all the section names associated with the specified initialization file, the return value is equal to the size specified by nSize minus two.

This function does not with QTP. this is because the returned string value is delimited with Null. so, QTP string are null terminated, so only the first string is returned, even that the buffer size is bigger.

Posted in Registry

Leave a Reply

You must be logged in to post a comment.

This article was viewed 440 times