By default, applications are locked and cannot be unloaded. To be classified as an “unloadable” application, the application must ensure that AutoCAD and other applications no longer refer to any objects or structures the application has defined. Before you make an application unloadable, be very careful that no client applications contain active pointers to any objects in your address space. For the list of cleanup operations an application must perform to be unloadable, see Preparing for Unloading.
If you want to make your application unloadable, you need to store the value of the pkt parameter sent with the AcRx::kInitAppMsg. The pkt parameter will be used by the unlockApplication() function. By default, an application is locked. If you unlock an application, it can be unloaded.
Use the following two functions to lock and unlock an application:
virtual bool AcRxDynamicLinker::lockApplication(void* pkt) const = 0; virtual bool AcRxDynamicLinker::unlockApplication(void* pkt) const = 0;
The following function checks whether or not an application is locked:
virtual bool AcRxDynamicLinker::isApplicationLocked(const char* name) const = 0;
Analogous global functions are also provided:
bool acrxLockApplication(void* pkt); bool acrxUnlockApplication(void* pkt); bool acrxApplicationIsLocked(const char* modulename);