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 |
|
Dmitry Kostochko
Add-in Express team
Posts: 2880
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.
|
|