WizKnowledge COM对象之IWizSettings,将设置信息保存到Xml设置文件中
var objSettings = new ActiveXObject(“WizKMCore.WizSettings”);
objSettings.Open(objApp.SettingsFileName); //打开用户设置文件
…
var initName = objSettings.StringValue(“Plugin_Speech”, “VocieName”); //从设置里面获得用户信息
…
objSettings.StringValue(“Plugin_Speech”, “VocieName”) = selectVoiceName.value; //保存用户信息到设置文件里面
- ProgID:WizKMCore.WizSettings
- 文件:WizKMCore.dll
object,
uuid(E3C896AD-3E1F-453E-800C-07A1837E2F23),
dual,
nonextensible,
helpstring("IWizSettings Interface"),
pointer_default(unique)
]
interface IWizSettings : IDispatch{
//打开设置文件
[id(1), helpstring("method Open")] HRESULT Open([in] BSTR bstrFileName);
//关闭设置文件
[id(2), helpstring("method Close")] HRESULT Close(void);
//判断设置文件是否已经修改了
[propget, id(3), helpstring("property IsDirty")] HRESULT IsDirty([out, retval] VARIANT_BOOL* pVal);
//获得/设置一个字符串信息
[propget, id(4), helpstring("property StringValue")] HRESULT StringValue([in] BSTR bstrSection, [in] BSTR bstrKey, [out, retval] BSTR* pVal);
[propput, id(4), helpstring("property StringValue")] HRESULT StringValue([in] BSTR bstrSection, [in] BSTR bstrKey, [in] BSTR newVal);
//获得/设置一个整数信息
[propget, id(5), helpstring("property IntValue")] HRESULT IntValue([in] BSTR bstrSection, [in] BSTR bstrKey, [out, retval] LONG* pVal);
[propput, id(5), helpstring("property IntValue")] HRESULT IntValue([in] BSTR bstrSection, [in] BSTR bstrKey, [in] LONG newVal);
//获得/设置一个布尔值
[propget, id(6), helpstring("property BoolValue")] HRESULT BoolValue([in] BSTR bstrSection, [in] BSTR bstrKey, [out, retval] VARIANT_BOOL* pVal);
[propput, id(6), helpstring("property BoolValue")] HRESULT BoolValue([in] BSTR bstrSection, [in] BSTR bstrKey, [in] VARIANT_BOOL newVal);
//获得一个Section,返回值是IWizSettingsSection对象
[propget, id(7), helpstring("property Section")] HRESULT Section([in] BSTR bstrSection, [out, retval] IDispatch** pVal);
//删除一个Section
[id(8), helpstring("method ClearSection")] HRESULT ClearSection([in] BSTR bstrSection);
};
object,
uuid(E70062FF-7718-4508-8545-3D38A13F3E9C),
dual,
nonextensible,
helpstring("IWizSettingsSection Interface"),
pointer_default(unique)
]
interface IWizSettingsSection : IDispatch{
//获得字符串值
[propget, id(1), helpstring("property StringValue")] HRESULT StringValue([in] BSTR bstrKey, [out, retval] BSTR* pVal);
//获得整数值
[propget, id(2), helpstring("property IntValue")] HRESULT IntValue([in] BSTR bstrKey, [out, retval] LONG* pVal);
//获得布尔值
[propget, id(3), helpstring("property BoolValue")] HRESULT BoolValue([in] BSTR bstrKey, [out, retval] VARIANT_BOOL* pVal);
};
最近评论