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

    // Property.cpp : CMyProperty 的实现

#include "stdafx.h"
#include "Property.h"
#include ".\property.h"


// CMyProperty


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

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

STDMETHODIMP CMyProperty::get_integer(LONG* pVal)
{
	*pVal = m_integer;
	return S_OK;
}

STDMETHODIMP CMyProperty::put_integer(LONG newVal)
{
	m_integer = newVal;
	return S_OK;
}