Share

AcRx Global Functions

Description

Defines global functions specific to AcRx classes.

Functions

Function Description
acrx_abort Terminates an ObjectARX application, prompting the user to save changes up to the beginning of the current command.Because ObjectARX applications are part of the same process as AutoCAD, it is not feasible to unwind the stack or to detect the damage done to memory by the application, so an extreme action is required to exit the program. The acrx_abort() function takes a format control string and optional additional arguments (the prompt) like acutPrintf().
acrxAppIsLoaded This function tests whether the ObjectARX application identified by pAppName is currently loaded.
acrxBuildClassHierarchy This function is used to rebuild the ObjectARX runtime class tree when new classes need to be added. It can be safely called at any time, but is necessary only after the rxInit() functions have been called for any classes to be added to the runtime tree. This is usually done inside the AcRx::kInitAppMsg case of the acrxEntryPoint() switch statement (or a function called from there). This function needs to be called only once after all the rxInit() calls have been made.For example:
acrxFindAcRxClass Look up for the class name in the AcRx class dictionary
acrxGetServiceSymbolAddr This function is a "C" code wrapper for:acrxDynamicLinker->getSymbolAddress(serviceName, symbol);which obtains the address of symbol and returns it as a void*. It's up to the application to then cast the void pointer to whatever it really is. If the service is not present or the symbol is not found, then NULL is returned.
acrxIsAppMDIAware Returns true if the ObjectARX or ObjectDBX module specified by moduleName has registered itself as MDI aware by calling acrxRegisterAppMDIAware(). Otherwise, returns false.
acrxLoadApp This function is a C code wrapper foracrxDynamicLinker->loadApp(appname, AcadApp::kOnLoadRequest, 0);which loads the appName ObjectARX program. appName is the application name as set in the operating system registry. If the ObjectARX application does not have an entry in the registry, or if the registry entry has the AcadApp::kLoadDisabled load reason set, or if AcadApp::kOnLoadRequest does not match the AcadApp::LoadReasons value in the application's registry entry, then this function will be unable to load the application.When asCmd is true, loading can happen only once. A second attempt to load will return false. The reference count for the application is... more
acrxLoadedApps This function returns a pointer to an AcDbVoidPtrArray that contains copies of the file names or URLs of all the currently loaded ObjectARX applications. These are the same strings that are reported by the AutoCAD ObjectARX command's "?" option.It is the caller's responsibility to free all the strings in the array and to delete the array itself when finished with it.
acrxLoadModule This function is a "C" code wrapper for:acrxDynamicLinker->loadModule(moduleName, printit);which loads the ObjectARX program whose file name is moduleName. If the file name does not have an ObjectARX extension, then moduleName must include the file extension. If printit is non-zero, then status messages such as "Runtime Extension is already loaded." or "AcRxDynamicLinker failed to load " will be printed on the AutoCAD command line.When asCmd is true, loading can happen only once. A second attempt to load will return false. The reference count for the application is not increased in this case. When asCmd is... more
acrxLockApplication This function is a "C" code wrapper for:acrxDynamicLinker->lockApplication(appId);which locks an application, thus preventing it from being unloaded until it is either unlocked or AutoCAD shuts down.The appId argument is the void pointer passed in as the second parameter to the application's acrxEntryPoint() function during the AcRx::kInitAppMsg call that occurs when the application is initially loaded.Only the void pointer passed into acrxEntryPoint() during the AcRx::kInitAppMsg call is valid for this function. So, if this function will be called at any other time, the void pointer passed in during the AcRx::kInitAppMsg call must be stored for later use.... more
acrxObjectDBXRegistryKey Returns a const string containing the ObjectDBX Registry root.
acrxProductLocale This function returns the locale identifier. For more information on locale identifiers see the Microsoft Visual C++ documentation.
acrxRegisterApp This function creates a temporary AcadAppInfo object on the stack, sets that AcadAppInfo object to use the logicalName and alr arguments, and then calls the AcadAppInfo object's writeToRegistry() function. This merely creates a key in the registry using the logical name and a LOADCTRLS value under that key. It does not create LOADER or DESCRIPTION values, nor does it create command or group entries. The LOADER value, which is required for demand loading, must be written by some other means.When this function returns, the local AcadAppInfo object is destroyed.Before using the AcadAppInfo::writeGroupNameToRegistry() or AcadAppInfo::writeCommandNameToRegistry() function, applications must call... more
acrxRegisterAppMDIAware This function registers the ObjectARX or ObjectDBX module identified by appId as MDI aware. Being MDI aware means that the application can handle AutoCAD's MDI mode.appId must be the pointer passed as the second argument to the application's acrxEntryPoint() function when that function is called for the AcRx::kInitAppMsg message.
acrxRegisterAppNotMDIAware This function registers the ObjectARX or ObjectDBX module identified by appId as not being MDI-aware. Not being MDI aware means that the application cannot handle AutoCAD's MDI mode. When any non-MDI-aware application is loaded in AutoCAD, AutoCAD runs in SDI mode.appId must be the pointer passed as the second argument to the application's acrxEntryPoint() function when that function is called for the AcRx::kInitAppMsg message.
acrxServiceIsRegistered This function is a "C" code wrapper for:acrxServiceDictionary->at(serviceName);which searches the service dictionary for an entry with the key serviceName. If the search is successful, then 1 is returned, otherwise 0 is returned.
acrxSysRegistry Returns a pointer to the ObjectARX system dictionary. The system dictionary contains all the system objects such as the AcRxDynamicLinker object, the AcTransactionManager object, the AcEditor object, the ObjectARX services dictionary, the dictionary of AcRxClass objects that make up the ObjectARX run-time class tree, etc.Normally ObjectARX programs do not need to explicitly use this function. Instead they use one of the global object access macros such as acedRegCmds or acrxServiceDictionary, which encapsulate a call to this function.
acrxUnloadApp This function is a "C" code wrapper for:acrxDynamicLinker->unloadApp(appName);which unloads the appName ObjectARX program. appName is the application name as set in the operating system registry. If the ObjectARX application was not loaded via the AcRxDynamicLinker::loadApp() or acrxLoadApp() method, or through the demand loading mechanism (all of which use the system registry entry for the application), then this function will be unable to unload the application.When asCmd is false, it's possible to call this method more than once and still get a successful return value. This method will simply decrement the reference count for the application.
acrxUnloadModule This function is a "C" code wrapper for:acrxDynamicLinker->unLoadModule(moduleName);which unloads the ObjectARX program whose file name is moduleName. The moduleName string must exactly match (case and all) the string used to load the module or else the unload may fail.When asCmd is false, it's possible to call this method more than once and still get a successful return value. This method will simply decrement the reference count for the application.
acrxUnlockApplication When ObjectARX applications are initially loaded, they are locked so they cannot be unloaded until AutoCAD shuts down. This function is a "C" code wrapper for:acrxDynamicLinker->unlockApplication(appId);which unlocks an application, thus making it unloadable at any time thereafter.The appId argument is the void* passed in as the second parameter to the application's acrxEntryPoint() function during the AcRx::kInitAppMsg call that occurs when the application is initially loaded.Only the void* passed into acrxEntryPoint() during the AcRx::kInitAppMsg call is valid to be used by this function. So, if this function will be called at any other time the void* passed... more
acrxUnregisterApp This function removes from the system registry the subtree with logicalName as the root key name within the "Application" key tree of the AutoCAD registry tree in the HKEY_LOCAL_MACHINE section of the registry.For example, if the AutoCAD section of the registry appears as so:

Topics

Was this information helpful?