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 return m_bstr_profilepath.CopyTo(pVal);
30 STDMETHODIMP CPrivateProfile::put_ProfilePath(BSTR newVal)
32 m_bstr_profilepath = newVal;
36 STDMETHODIMP CPrivateProfile::OpenSection(VARIANT text,VARIANT* pVal)
40 if(varText.ChangeType(VT_BSTR,&text) != S_OK){
41 return DISP_E_TYPEMISMATCH;
43 if (m_bstr_profilepath.Length() <= 0) {
44 ErrorInfo(IDS_ERR_PROFILEPATH);
45 return DISP_E_EXCEPTION;
47 CComObject<CProfileSection>* pSection = NULL;
48 pSection->CreateInstance(&pSection);
51 pSection->m_szProfilePath = m_bstr_profilepath;
52 pSection->m_szSectionName = varText.bstrVal;
54 IUnknown* pUnk = NULL;
55 pSection->QueryInterface(IID_IUnknown,(void**)&pUnk);
57 pVal->vt = VT_UNKNOWN;