在app类中,声明了若干全局变量,比如下面:
CMyApp theApp;
MTestMgr theTestMgr;
CTimeSync theTimeSync;
MSockComm theSockComm;
CMFlowProc theFlowProc;
MReporter t theReporter;
如果想在新开的线程里面用MTestMgr类成员函数。可以直接在新开线程所在的类里面添加一个成员变量MTestMgr m_testmgr吗? 如果可以的话,怎么进一步将m_testmgr和全局变量关联起来呢?
CMyApp theApp;
MTestMgr theTestMgr;
CTimeSync theTimeSync;
MSockComm theSockComm;
CMFlowProc theFlowProc;
MReporter t theReporter;
如果想在新开的线程里面用MTestMgr类成员函数。可以直接在新开线程所在的类里面添加一个成员变量MTestMgr m_testmgr吗? 如果可以的话,怎么进一步将m_testmgr和全局变量关联起来呢?
...
然后用m_testmgr,
线程处理函数的参数,不是最好由pParam传递进去吗? 这样相当于传参数进去,会不会有影响?
这种传参数的方法,和由pParam传参数的方法,有什么不同?