AcMapAliasesReactor class

Land Desktop Development ARX CPP SDK

 

AcMapAliasesReactor class

Header file: MapReactors.h.

The AcMapAliasesReactor class is used to represent a drive alias reactor, which notifies an application of drive alias events.

To create a specific drive aliases reactor, subclass from AcMapAliasesReactor.

Use AcMapAliases::AddReactor to add the reactor to a drive alias and AcMapAliases::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 AcMyAliasesReactor : public AcMapAliasesReactor
{
   // See MapDemoApp.cpp distributed with AutoCAD Map ObjectARX. 
} ;
 
static AcMyAliasesReactor *pAliasReact ;
 
AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg, void *appId)
{
   AcMapSession   *mapApi = NULL; 
   switch (msg) { 
      case AcRx::kInitAppMsg: 
         acrxRegisterAppMDIAware(appId); 
         //register commands -- code not shown 
         pAliasReact = new AcMyAliasesReactor() ; 
         mapApi = AcMapGetSession(); 
         AcMapAliases *pAlias = NULL ; 
         mapApi->GetAliases(pAlias); 
         pAlias->AddReactor(pAliasReact) ; 
         break ; 
      case AcRx::kUnloadAppMsg: 
          delete pAliasReact ; 
          pAliasReact = NULL ; 
          break ; 
      case AcRx::kUnloadDwgMsg: 
         mapApi = AcMapGetSession(); 
         AcMapAliases *pAlias = NULL ; 
         mapApi->GetAliases(pAlias); 
         pAlias->RemoveReactor(pAliasReact) ; 
         break ; 
   } 
return AcRx::kRetOK;
}