Architecture of COM add-in, smart tag and RTD sever
projects in Delphi 5, 6, 7, 2005, 2006 and Delphi 20007
Add-in Express™
for Microsoft® Office and CodeGear® VCL
Add-in Express project architecture
Add-in Express VCL is written in Delphi and directly supports Delphi for Win32 versions 5, 6, 7, 2006 and 2007. All projects that can be created with Add-in Express are located on the Add-in Express VCL tab of the New Items dialog box (File | New | Other). The projects are:
- ADX COM Add-in - a COM add-in project.
- ADX Outlook Add-in - an Outlook-specific COM add-in project.
- ADX Excel RTD Server - a real-time data server project.
- ADX Outlook Form - a form that can be embedded into Outlook windows.
- ADX Smart Tag - a smart tag project.
- ADX Excel Worksheet - a COM add-in bound to a specified Excel worksheet.
- ADX Word Document - a COM add-in bound to a specified Word document.

Each Add-in Express project is an ActiveX library (DLL, an in-process COM server) that contains one or several Automation objects realizing the interfaces required by the supported technology, e.g. IDTExtensibility2, IRibbonExtensibility, IRtdServer or ISmartTagRecognizer. By default, every project based on Add-in Express includes type library files (binary and Object Pascal unit) and the RAD module that implements all technology-specific interfaces and centralizes your applied code (marked by the _IMPL suffix).

The RAD module is the "heart" of your project. It is a descendant of the Data Module that has its own visual designer. You concentrate your development around this module since it is a container for all Office-specific components (like TDataModule that is a container for DB components) and it provides "access points" for handling Office objects. Thus, the RAD module is the place where your write your applied code. Below you can find the initial source code of the RAD module generated by Add-in Express:
unit MyOutlookAddin_IMPL;
interface
uses
SysUtils, ComObj, ComServ, ActiveX, Variants, Office2000,
adxAddIn, MyOutlookAddin_TLB, Outlook2000;
type
TOlAddin = class(TadxAddin, IOlAddin)
end;
TAddInModule = class(TadxCOMAddInModule)
procedure adxCOMAddInModuleAddInInitialize(Sender: TObject);
procedure adxCOMAddInModuleAddInFinalize(Sender: TObject);
protected
procedure OptionsPagesAdd(ASender: TObject;
const Pages: PropertyPages); override;
end;
var
adxOlAddin: TAddInModule;
implementation
{$R *.dfm}
procedure TAddInModule.adxCOMAddInModuleAddInInitialize(Sender: TObject);
begin
adxOlAddin := Self;
end;
procedure TAddInModule.adxCOMAddInModuleAddInFinalize(Sender: TObject);
begin
adxOlAddin := nil;
end;
procedure TAddInModule.OptionsPagesAdd(ASender: TObject; const Pages: PropertyPages);
begin
Pages.Add('MyOutlookAddin.MyOptions', 'My Options');
end;
initialization
TadxFactory.Create(ComServer, TOlAddin, CLASS_OlAddin, TAddInModule);
end.

