AutoCAD as an In-Place Server

When you install AutoCAD, the in-place activation control (AcCtrl.dll) is put in the Autodesk Shared directory and registered in the registry.

To describe how to use the in-place activation control, this part of the guide uses the program name Display.exe for example purposes only. Substitute for Display.exe the name of the program you write to host AutoCAD in a child window.

The following process explains how the in-place activation control allows AutoCAD product to act as an in-place server:

  1. Your host program, Display.exe, creates an instance of the AutoCAD in-place activation control.

    For example, if you are writing Display.exe in Visual Basic, you create a Component reference to AutoCAD's copy of the in-place activation control, and you draw the control on a form. Then you instantiate the control in an event's code and pass the control a file name to insert into the control's Src property.

    Note: The size and position that you provide when you draw the control determine the size and position of the Display.exe document frame.
  2. At run time, when Display.exe instantiates the control, the control starts AutoCAD with the -InPlaceServer flag on the command line. AutoCAD's main window is not displayed because of the -InPlaceServer flag on the command line.
  3. The control connects to the AcIPDocument object exposed by AutoCAD and passes the file name and the control's window handle to the object.
  4. AutoCAD opens the file as it normally would but presents the frame window as a child of the in-place activation control, not of the product's own main frame. As a result, AutoCAD’s document window appears in a child window of Display.exe. AutoCAD is acting as an in-place server to Display.exe.
  5. After the control has been instantiated and has a file name in its Src property, Display.exe can pass commands to the control using the PostCommand method.