Referencing the AddInModule

Add-in Express™ Support Service
That's what is more important than anything else

Referencing the AddInModule
 
David Golden




Posts: 11
Joined: 2006-03-07
Hi,

Sorry if I don't quite use the right jargon in this one, but I've got a form added to my addin that I would like to use one of the controls on the Addin Module, but I'm having some trouble referencing it.

For example a normal Application would have a variable declared for the form.. say fMain: TfMain, yet no matter the name of the AddInModule, you never get an AddinModule: TAddInModule as a reference (its been explained to me that while its possible to do this, it won't work when using the addin)

Is there a way to reference back to a component on the AddinModule or do I have to somehow modify the ADX class?

Thanks
Posted 02 May, 2006 00:38:53 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi David,

If I understand you right, it is possible. See the piece of code below.


interface

type
  TAddInModule = class(TadxCOMAddInModule)
    procedure adxCOMAddInModuleAddInInitialize(Sender: TObject);
    procedure adxCOMAddInModuleAddInFinalize(Sender: TObject);
  private
  protected
  public
  end;
[B]
var
  adxModule: TAddInModule;[/B]

implementation

{$R *.dfm}

procedure TAddInModule.adxCOMAddInModuleAddInInitialize(Sender: TObject);
begin
  [B]adxModule := Self;[/B]
  // TODO
end;

procedure TAddInModule.adxCOMAddInModuleAddInFinalize(Sender: TObject);
begin
  // TODO
  [B]adxModule := nil;[/B]
end;


If I missed anything, please let me know.

Posted 03 May, 2006 07:39:05 Top