两种方法解决:
想办法传一个this指针进去或使用全局变量。
1)用全局变量
2)this指针
class CChangeUPSTime
{
public:
static pascal OSStatus MainWindowEventHandler();
private:
static CChangeUPSTime *m_pThis;
WindowRef m_WindowRef;
};
CChangeUPSTime *CChangeUPSTime::m_pThis = NULL;
CChangeUPSTime::CChangeUPSTime()
{
m_pThis = this;
}
OSStatus CChangeUPSTime::MainWindowEventHandler(){
m_pThis->m_WindowRef = NULL;
}
原文:http://yaycici.blog.163.com/blog/static/173759063201291741815353/