MFC编程怎么在自写的函数中调用其他类的成员变量

2025-03-18 16:13:12
推荐回答(1个)
回答1:

想办法获得CRubberbandView的一个指针,用指针调用那个函数
如果你那个View已经注册过,且处于active 状态,可用
//#include "mainframe.h"
//#inlcude "ruberandview.h"
CMainFrame *pMain=(CMainFrame *)AfxGetApp()-> m_pMainWnd;
CRubberbandView *pView=(CRubberbandView *)pMain-> GetActiveView();
pView->bresenham();