vc里面静态的成员函数不能调用类的公共变量么?
如果把变量定义成静态的,就可以调用,可是我是用ado写数据库程序,我在类的public里面声明了
_ConnectionPtr m_pConn;//connection
可是我在一个静态的成员函数里面调用
m_pConn.GetInterfacePtr()
出现错误,错误信息为:
E:\毕业设计程序\复件 myGetPacket\myGetPacketDlg.cpp(279) : error C2228: left of '.GetInterfacePtr' must have class/struct/union type
---------------
如果我把m_pConn定义前面加static,编译通过,可是build失败,错误信息为:
unresolved external symbol "public: static class _com_ptr_t<class _com_IIID<struct _Connection,&struct __s_GUID _GUID_00000550_0000_0010_8000_00aa006d2ea4> > CMyGetPacketDlg::m_pConn" (?m_pConn@CMyGetPacketDlg@@2V...
----------------
请问该怎么搞??
---------------------------------------------------备注,我的成员函数由于要作为线程的回调函数,所以必须设置成静态的成员函数
如果把变量定义成静态的,就可以调用,可是我是用ado写数据库程序,我在类的public里面声明了
_ConnectionPtr m_pConn;//connection
可是我在一个静态的成员函数里面调用
m_pConn.GetInterfacePtr()
出现错误,错误信息为:
E:\毕业设计程序\复件 myGetPacket\myGetPacketDlg.cpp(279) : error C2228: left of '.GetInterfacePtr' must have class/struct/union type
---------------
如果我把m_pConn定义前面加static,编译通过,可是build失败,错误信息为:
unresolved external symbol "public: static class _com_ptr_t<class _com_IIID<struct _Connection,&struct __s_GUID _GUID_00000550_0000_0010_8000_00aa006d2ea4> > CMyGetPacketDlg::m_pConn" (?m_pConn@CMyGetPacketDlg@@2V...
----------------
请问该怎么搞??
---------------------------------------------------备注,我的成员函数由于要作为线程的回调函数,所以必须设置成静态的成员函数
把m_pConn.GetInterfacePtr 换成variant_t((IDispatch*)theApp.mpConn,true
把m_pConn.GetInterfacePtr 换成variant_t((IDispatch*)theApp.mpConn,true)
刚才少了个括号