Microsoft Excel reporting and 
 data analyzing with practically no coding. 
 .Net, ActiveX, and VCL versions. 
 www.AfalinaSoft.com  

Home    Products    Downloads    Registered users    Support    Prices    Order    Primary Subscription

 

MS Office COM Add-ins. Microsoft Excel reporting 
 and data analyzing


Add-in Express Wizard - Office Add-in Express Developer's Guide

<< Previous

Table of contents

Next >>


Let's go

Where? \QDemo\First\FirstAddIn.dpr

The components and COM development in Borland Delphi is not a visual process. That's why this document contains a lot of well-commented source code. To create a COM add-in with Add-in Express you should make two standard steps described below.

Step #1 - Add-in Express Wizard

To create a COM Add-in project choose File|New|Others (File|New for Delphi 5) and go to the Add-in Express tab in the New Items window and double-click the MS Office COM Add-in icon. This will start the Add-in Express Wizard. With this, you can specify a name of the COM add-in project, a destination folder for the project, one or several host applications COM add-in is being designed for, a display name for the COM Add-in coclass and more.

To create a COM Add-in project choose File|New|Others (File|New for Delphi 5) and go to the Add-in Express tab in the New Items window and double-click the MS Office COM Add-in icon. This will start the Add-in Express Wizard. With this, you can specify a name of the COM add-in project, a destination folder for the project, one or several host applications COM add-in is being designed for, a display name for the COM Add-in coclass and more

First, you should name the add-in project. For example we name the first add-in project FirstAddIn and place it into the C:\ADXTest folder.

Add-in Express Wizard: select project name and destination directory

Second, you should choose one or several host applications COM add-in is being designed for. In this example we select only MS Excel.

Add-in Express Wizard: select host application

Third, you should specify a coclass name that will be used as a name of add-in interfaces and a name of the class that implement add-in. Also the Add-in Express Wizard allows you to specify an add-in display name and an add-in description that will be displayed in the COM Add-in Manager of the host application.

Add-in Express Wizard: name add-in and add-in coclass

Finally, you should check your settings and press the Finish button <g>

Add-in Express Wizard: check your settings

When the Add-in Express Wizard is finished, the COM Add-in project will be created and opened in Delphi IDE. The COM Add-in project is an ActiveX library that contains only one Automation object that implements the COM Add-in. The sample project includes the following modules:

  • The project source files (ProjectName.*);
  • The type library files: binary (ProjectName.tlb) and Object Pascal unit (ProjectName_TLB.pas);
  • The unit that implements the COM Add-in (ProjectName_IMPL.pas).

Among all modules described here only the ProjectName_IMPL.pas unit is of importance for you. In this example and in all of your feature projects this unit contains the following code:

unit FirstAddIn_IMPL;

interface

uses
ComObj, ComServ, ActiveX, Dialogs, axpAddIn, FirstAddIn_TLB;

type
TMyFirstAddIn = class(TaxpAddIn, IMyFirstAddIn)
protected
{ Protected declarations }
procedure AddIn_Initialize; override;
procedure AddIn_Finalize; override;
procedure AddIn_ControlEvent(const Tag: string; ICtrl: IaxpControl); override;
end;

implementation

{ TMyFirstAddIn }

procedure TMyFirstAddIn.AddIn_Initialize;
begin
inherited;
end;

procedure TMyFirstAddIn.AddIn_Finalize;
begin
inherited;
end;

procedure TMyFirstAddIn.AddIn_ControlEvent(const Tag: string;
ICtrl: IaxpControl);
begin
end;

initialization
TaxpFactory.CreateEx(ComServer, TMyFirstAddIn, Class_MyFirstAddIn,
[ohaExcel], 'First COM Add-in',
'The first COM add-in for MS Excel that is being designed through Add-in Express');
end.

The TMyFirstAddIn class implements the COM Add-in (as Automation object) and is a descendant of the TaxpAddIn class. The TaxpAddIn class implements the IDTExtensibility2 interface in order to make the in-process Automation Server be a real COM Add-in and it defines the way of development. See step #2 for more details.

<< Previous

Table of contents

Next >>



Developed for

Delphi 5, 6, 7
Excluding Delphi Personal


[ Download it ]

[ Order now ]

Immediate shipment




ADX Toys™

Free sample
add-ins with a complete source code based on Add-in Express.

[  Read more  ]




We are Borland 
 technology partner


Copyright © 1999-2006
All right reserved.
Privacy Policy

Write to WebMaster

Page Top
Add-in Express - Visual tool for Office customization