Designing Add-ins

Home Page (Add-ins)OverviewHow Do I ... TopicsFAQReference

Before you create an add-in, you should consider the following design issues:

  • What tasks will the add-in perform?

  • Could you use a VBScript macro to perform these tasks?

    You can write a macro more quickly and easily than you can write an add-in. Before you begin, carefully consider the differences between macros and add-ins.

  • What commands will the add-in use to perform its tasks?

  • Which Developer Studio objects will you reference in the add-in's commands?

  • Which Developer Studio methods and properties will you use in the add-in's commands?

  • How many add-ins will you need?

    If you need several, you can combine them in the same DLL.

  • Will the add-in display windows or dialog boxes?

    An add-in can display modal windows or dialog boxes; however, it cannot display modeless windows or dialog boxes. For details, see the EnableModeless method.

  • Will the add-in handle events?

    An add-in can handle events fired by Developer Studio objects. Additionally, an add-in can display a dialog box containing ActiveX controls that fire events in the add-in. The controls' container (the dialog box or add-in) can handle the events.

  • Will the add-in control another application?

    An add-in can control another executable file (.EXE) by serving as an out-of-process controller for the other application.

  • Will the add-in have more than one thread?

    If you create a multithreaded add-in, the results are unpredictable. An add-in can have multiple threads if none of them has a message pump and only one thread accesses the Developer Studio object model.

  • Will the add-in carry out another add-in's commands?

  • Will the add-in have a Help file?

    Visual C++ cannot display a Help file created for an add-in. The add-in must expose a dedicated command to display a Help file.

Tip   To get some ideas for add-ins, look at the sample add-ins.