1 // PrivateProfile.cpp : CPrivateProfile
\82Ì
\83C
\83\93\83v
\83\8a\83\81\83\93\83e
\81[
\83V
\83\87\83\93
3 #include "SeraphyScriptTools.h"
4 #include "PrivateProfile.h"
5 #include "profilesection.h"
8 /////////////////////////////////////////////////////////////////////////////
11 STDMETHODIMP CPrivateProfile::InterfaceSupportsErrorInfo(REFIID riid)
13 static const IID* arr[] =
17 for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
19 if (IsEqualGUID(*arr[i],riid))
25 STDMETHODIMP CPrivateProfile::get_ProfilePath(BSTR *pVal)
27 *pVal = m_bstr_profilepath.copy();
31 STDMETHODIMP CPrivateProfile::put_ProfilePath(BSTR newVal)
33 m_bstr_profilepath = newVal;
37 STDMETHODIMP CPrivateProfile::OpenSection(VARIANT text,VARIANT* pVal)
41 if(varText.ChangeType(VT_BSTR,&text) != S_OK){
42 return DISP_E_TYPEMISMATCH;
44 if(m_bstr_profilepath.length() <= 0){
45 ErrorInfo(IDS_ERR_PROFILEPATH);
46 return DISP_E_EXCEPTION;
48 CComObject<CProfileSection>* pSection = NULL;
49 pSection->CreateInstance(&pSection);
51 WideCharToMultiByte(GetACP(),0,m_bstr_profilepath,-1,pSection->m_szProfilePath,MAX_PATH,NULL,NULL);
52 WideCharToMultiByte(GetACP(),0,varText.bstrVal ,-1,pSection->m_szSectionName,MAX_PATH,NULL,NULL);
53 IUnknown* pUnk = NULL;
54 pSection->QueryInterface(IID_IUnknown,(void**)&pUnk);
56 pVal->vt = VT_UNKNOWN;