gusucode.com > COM组件设计与应用(十八)——属性包C++源码程序 > COM组件设计与应用(十八)——属性包/comtut18src/ComP18/Simple18/Property.cpp

    // Property.cpp : Implementation of CProperty
#include "stdafx.h"
#include "Simple18.h"
#include "Property.h"

/////////////////////////////////////////////////////////////////////////////
// CProperty


STDMETHODIMP CProperty::get_str(BSTR *pVal)
{
	*pVal = m_str.Copy();
	return S_OK;
}

STDMETHODIMP CProperty::put_str(BSTR newVal)
{
	m_str = newVal;
	return S_OK;
}

STDMETHODIMP CProperty::get_integer(long *pVal)
{
	*pVal = m_integer;
	return S_OK;
}

STDMETHODIMP CProperty::put_integer(long newVal)
{
	m_integer = newVal;
	return S_OK;
}