c++ - 如何删除 IPropertyStorage 自动添加的 LOCALE 属性?

标签 c++ ipropertystorage

根据IPropertyStorage::WriteMultiple Method的备注部分...

When a new property set is created, the special codepage (Property ID 1) and Locale ID (Property ID 0x80000000) properties are written to the property set automatically.

但是,我希望我的 PropertySet 省略 LOCALE ID。我已经尝试过了

specs[0].ulKind = PRSPEC_PROPID;
specs[0].propid = PID_LOCALE;
//specs[0].lpwstr = 0;
hr = pPropStorage->DeleteMultiple(1, specs);

但这失败了

0x80030057 Invalid parameter error

如何忽略这个不需要的属性 ID?我尝试在之前和之后执行 IPropertyStorage::Commit() 。但调用 DeleteMultiple() 时会产生相同的错误。

注意:我尝试过使用和不使用specs[0].lpwstr = 0;但这很愚蠢,因为它是与 propid 的“union ”,所以将它们都写下来会改变第一个。但仅设置 propid = PID_LOCALE 时仍然失败。

最佳答案

尝试将DeleteMultiple 放在Create 之后。

关于c++ - 如何删除 IPropertyStorage 自动添加的 LOCALE 属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11903031/

相关文章:

powershell - 是否可以获取不在 shell 命名空间中的项目的 shell 属性?

c++ - 双击 QLabel

c++ - 分布式 dll 和 c++ 对象 - 一些库如何处理这个?

c++ - 如何获取 SDL2 中视频卡支持的所有分辨率?

c++ - RAII状态管理

c++ - 一组没有更新的整数的完美哈希函数