Share

AcRxDynamicLinker::registerService

C++

virtual AcRxObject* registerService(
    const ACHAR * serviceName, 
    AcRxService* serviceObj
) = 0;

Description

This function fills the serviceObjAcRxService object in with the information about the ObjectARX program registering the service (that is, the application calling this function) and then adds the serviceObj object to the ObjectARX Service Registry using serviceName as the lookup key.

Warning

If serviceName is already present in the registry, an orderly termination of AutoCAD occurs. A call to the global function acrxServiceIsRegistered(char* serviceName) should be made to determine that serviceName is not already present.

Note

The global acrxRegisterService() function encapsulates the creation of the AcRxService object and the call to this method into one function.

AcRxService *srvcObj = new AcRxService;
acrxDynamicLinker->registerService(serviceName, srvcObj);
Note

registerService() registers services for whatever ObjectARX program was most recently loaded into AutoCAD. The only time that you can be sure your application is the most recently loaded application is when your application's acrxEntryPoint() is called with AcRx::kInitAppMsg as the first argument. Therefore, you should only register services during this call.

Parameters

Parameters Description
serviceName Input text string that will be the service name used to identify the serviceObj object in the service registry
serviceObj Input pointer to dynamically allocated AcRxService object

Links

AcRxDynamicLinker

Was this information helpful?