3,245
社区成员
发帖
与我相关
我的任务
分享
class ATL_NO_VTABLE CFoo:
public CComObjectRootEx<CComSingleThreadModel>,
...
{
...
private:
short m_sPropertyA;
...
public:
STDMETHOD(get_PropertyA)(SHORT* pVal);
STDMETHOD(put_PropertyA)(SHORT newVal);
}
STDMETHODIMP CFoo::get_PropertyA(SHORT* pVal)
{
// TODO: Add your implementation code here
*pVal = m_sPropertyA;
return S_OK;
}
STDMETHODIMP CFoo::put_PropertyA(SHORT newVal)
{
// TODO: Add your implementation code here
m_sPropertyA = newVal;
return S_OK;
}
int FunA()
{
short s = m_sPropertyA; // error
}
//以上都可以正常使用 m_sPropertyA 这个变量
//但是自己在这个源文件定义一个新的函数,就不能使用这个内部变量了,应该怎么办呢?