Using ObjectARX APIs to Simplify Registry Setup

ObjectARX provides APIs that simplify the task of writing demand load entries to the registry. Though install time is preferable for writing initial registry entries, these APIs may be useful if you need to change your demand load information at runtime. For instance, an application could write default settings to HKEY_LOCAL_MACHINE at installation, and then use these APIs to write user-specific values to HKEY_CURRENT_USER at runtime.

The AcadAppInfo class functions and the acrxRegisterApp() global function write registry entries to the location dictated by the current user's privileges. If the user has power user privileges, then the entries are written under HKEY_LOCAL_MACHINE. Otherwise, they are written under HKEY_CURRENT_USER.

The AcadAppInfo::writeToRegistry() function writes all registry entries required for demand loading. It provides an argument that forces entries to be written to the HKEY_CURRENT_USER hive, even if the user has write permissions in HKEY_LOCAL_MACHINE. See writeToRegistry in the ObjectARX Reference for details.

The following methods provide the ability to write group and command demand load information to the registry:

The acrxRegisterApp() global function is a single-call wrapper for AcadAppInfo that performs partial registry setup. You can use this function in conjunction with your own AcadAppInfo object. See acrxRegisterApp in the ObjectARX Reference for detailed documentation and important caveats.