PC Camera开发日志(二十六)--- INI文件中某段SECTION删除

本文详细介绍了WritePrivateProfileStruct函数的使用方法及其参数说明。此函数用于将数据写入指定初始化文件的部分,并计算校验和以确保数据完整。文中还提到了函数的应用场景及注意事项。

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);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值