这是我想到的...它工作
- class ExtDocReactor : public AcApDocManagerReactor
- {
- private:
- CPaletteBlockChildDlg *mpDlg;
- public:
- ExtDocReactor (CPaletteBlockChildDlg *dlg):mpDlg(dlg){
- acDocManager->addReactor (this) ;
- }
- ~ExtDocReactor () {
- if ( acDocManager != NULL )
- acDocManager->removeReactor (this);
- }
- virtual void documentActivated(AcApDocument* pActivatedDoc) {
- if(mpDlg)
- mpDlg->OnDocumentActivated(pActivatedDoc);
- }
- };
同时在 CPaletteBlockChildDlg 这个 mojo 正在工作
- CPaletteBlockChildDlg::CPaletteBlockChildDlg (CWnd *pParent /*=NULL*/, HINSTANCE hInstance /*=NULL*/)
- : CAcUiDialog (CPaletteBlockChildDlg::IDD, pParent, hInstance)
- {
- //{{AFX_DATA_INIT(CPaletteBlockChildDlg)
- mExtDocReactor = new ExtDocReactor(this);
- m_locale = _get_current_locale();
- //}}AFX_DATA_INIT
- }
|