Creating a New Tool Palette API Project

The most efficient way to start a Tool Palette application is to use the ObjectARX wizard. The procedures in this section use the ObjectARX wizard to handle most ObjectARX setup tasks. You can install this wizard from the AutoCAD Developer Center.

After the wizard is installed, a new icon for ObjectARX C++ applications appears in Visual Studio's dialog box when you start a new project. This icon launches the ObjectARX wizard. The wizard provides options for creating several types of Autodesk projects. It also lets you set MFC, COM, and ATL options, as you would with a Microsoft project wizard. A project generated by the ObjectARX wizard modifies Microsoft's default project setups to resolve conflicts between ObjectARX or ObjectDBX module structure and Microsoft requirements. The wizard also installs permanent UI toolbars in Visual Studio, additional templates, and boilerplate code. These tools hide most of the complexity of setting up an ObjectARX project.

To set up your Tool Palette application using the ObjectARX wizard

  1. In Visual Studio, start a new project.
  2. In the New Project dialog box, provide a name and location.
  3. Select ObjectARX/DBX/OMF Project to launch the wizard.
  4. Enter your registered developer symbol in the Overview settings.
  5. In the MFC Support tab, choose Extension DLL using MFC Shared DLL.
  6. In the COM Options tab, choose Implement a COM server using ATL.
  7. Click Finish.

You now have a project that combines ATL, the MFC framework, and the standard ObjectARX application infrastructure. The ObjectARX wizard adds a class to handle per-document data. In this basic project you do not need to store document data, so you should remove this unnecessary code.

To remove CDocData elements

  1. Near the end of the stdafx.h file, remove the following lines:
    #include "DocData.h"						//----- Your document specific data
    //----- Declare it as an extern here so that it becomes available // in all modules
    extern AcApDataManager<CDocData> DocVars ;
  2. Remove the DocData.h and DocData.cpp files from your project.