16,472
社区成员
发帖
与我相关
我的任务
分享
class CxxApp : public CWinAppEx
{
// 1. 在CxxApp类.h中加入如下变量
public:
CAWin * m_pA;
CBWin * m_pB;
CCWin * m_pC;
// 2. 在CxxApp 构造函数中初始化这个几变量
CxxApp::CxxApp()
: m_pA(0)
, m_pB(0)
, m_pC(0)
{
....
}
// 3. 在MainFrame中赋值
theApp.m_pA = new A();
theApp.m_pB = new B();
theApp.m_pC = new C();
// 4. 在任何类中使用
theApp.m_pA->setdata(...);
theApp.m_pB->init(...);
theApp.m_pC->getrect();
等以后熟了,再用其它的方法。