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::get_ProfilePath(BSTR *pVal)
13 return m_bstr_profilepath.CopyTo(pVal);
16 STDMETHODIMP CPrivateProfile::put_ProfilePath(BSTR newVal)
18 m_bstr_profilepath = newVal;
22 STDMETHODIMP CPrivateProfile::OpenSection(VARIANT text, VARIANT* pVal)
28 if (FAILED(hr = varText.ChangeType(VT_BSTR, &text))) {
32 if (m_bstr_profilepath.Length() <= 0) {
33 return Error(IDS_ERR_PROFILEPATH);
36 CComObject<CProfileSection>* pSection = NULL;
37 if (FAILED(hr = CComObject<CProfileSection>::CreateInstance(&pSection))) {
42 CComPtr<IUnknown> pUnk = NULL;
43 if (FAILED(hr = pSection->QueryInterface(&pUnk))) {
49 pSection->m_szProfilePath = m_bstr_profilepath;
50 pSection->m_szSectionName = varText.bstrVal;
52 pVal->vt = VT_UNKNOWN;
53 pVal->punkVal = pUnk.Detach();