Initializing an ObjectARX Application

You must initialize any custom classes and commands that your application defines. This initialization can take place in either the AcRx::kInitAppMsg case of your acrxEntryPoint() function, or in a function called from that case.

To initialize an ObjectARX application

  1. If you have defined a custom class, invoke its rxInit() function.

    Defining custom classes is discussed in detail in "Deriving a Custom ObjectARX Class".

  2. If you have defined custom classes, call acrxBuildClassHierarchy() to rebuild the ObjectARX runtime class tree.

    For efficiency, call acrxBuildClassHierarchy() once after calling the rxinit() function for each of your custom classes.

  3. Perform any other initialization that you need.
  4. Register a service name.

    Registering a service name is suggested if other applications will depend upon your application. Registering a service name allows other applications to register depending on the service, and allows your application to check if it has any dependencies before unloading. Registering a service name for your application is also necessary if you are going to export symbolic functions from your application using the ObjectARX mechanism. You can use the function acrxRegisterService(), or use the AcRxService class. For more information on registering services, see "AcRxService" in the ObjectARX Reference.

  5. Register commands with the AutoCAD command mechanism.

    Use acedRegCmds->addCommand() to make AutoCAD aware of the commands that your application defines. For more information, see "Registering New Commands".