Header file: MapReactors.h.
The AcMapDrawingSetReactor class is used to represent a drawing set reactor, which supplies callbacks to notify an application immediately of drawing set events.
To create a specific drawing set reactor, subclass from AcMapDrawingSetReactor.
Use AcMapDrawingSet::AddReactor to add a reactor to a drawing set and AcMapDrawingSet::RemoveReactor to remove it.
Use AcMapDrawingSet::AddReactor to add the reactor to a drawing set and AcMapDrawingSet::RemoveReactor to remove it. Delete the pointer to the reactor using the delete operator when you unload the application, as shown in the following example. For simplicity, error checking is not shown.
class AcMyDrawingSetReactor : public AcMapDrawingSetReactor { // See MapDemoApp.cpp distributed with AutoCAD Map ObjectARX. } ; static AcMyDrawingSetReactor *pDSetReact ; AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg, void *appId) { AcMapSession *mapApi = NULL; switch (msg) { case AcRx::kInitAppMsg: acrxRegisterAppMDIAware(appId); //register commands -- code not shown pDSetReact = new AcMyDrawingSetReactor() ; mapApi = AcMapGetSession(); AcMapDrawingSet *pDSet = NULL ; pProj->GetDrawingSet(pDSet); pDSet->AddReactor(pDSetReact) ; break ; case AcRx::kUnloadAppMsg: delete pDSetReact ; pDSetReact = NULL ; break ; case AcRx::kUnloadDwgMsg: mapApi = AcMapGetSession(); AcMapDrawingSet *pDSet = NULL ; pProj->GetDrawingSet(pDSet); pDSet->RemoveReactor(pDSetReact) ; break ; } return AcRx::kRetOK;