WritePrivateProfileStruct
The WritePrivateProfileStruct function copies data into a key in the specified section of an intialization file. As it copies the data, the function calculates a checksum and appends it to the end of the data. The GetPrivateProfileStruct function uses the checksum to ensure the integrity of the data.
Note: This function is provided only for compatibility with 16-bit version of windows. Applications should store initialization information in the registry.
BOOL writePrivateProfileStruct
(
LPCTSTR lpszSection, // section name
LPCTSTR lpszKey, // key name
LPVOID lpStruct, // data buffer
UINT uSizeStruct, // size of data buffer
LPCTSTR szFile // initialization file
);
Parameters
lpszSection
[in] pointer to a null-terminated string containing the name of the section to which the string will be copied. If the section does not exist, it is created. The name of the section is case independent, the string can be any combination of uppercase and lowercase letters.
lpszKey
[in] pointer to the null-terminate string containing the name of the key to be associated with a string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all keys and entire within the section, is deleted.
lpStruct
[in] pointer to a buffer that contains the data to copy. If this parameter is NULL, the given key is deleted.
uSizeStruct
[in] specified the size, in bytes, of the buffer pointer to by the lpStruct parameter.
szFile
[in] pointer to a null-terminated string that names the initialization file. If this parameter is NULL, the given information is copied into the Win.ini file.
example:
WritePrivateProfileStruct(_T("AniFrame"),NULL,NULL,0,m_ConfPath);