Uwe
Guest
|
Hi, in adxCOMAddInModuleAddInInitialize I do
Application.CreateForm(TDataModule1, datamodule1);
Application.CreateForm(TFormImport, FormImport);
Application.CreateForm(TFormMain, FormMain);
FormMain.adx := self;
to create forms, which works fine.
But one problem is: In the FormCreate I have:
procedure TFormMain.FormCreate(Sender: TObject);
var
f: TextFile;
s: String;
sDir: String;
begin
MessageDlg('Create Main', mtInformation, [mbOK], 0);
try
sDir := adx.COMAddInClassFactory.FilePath;
MessageDlg('Create Main 2', mtInformation, [mbOK], 0);
chdir (sDir);
...
The line
sDir := adx.COMAddInClassFactory.FilePath;
throws an exception.
Why can I not acces the FilePath?
Thanks,
Uwe
|
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
Joined: 2004-04-05
|
Hi Uwe,
Why can I not acces the FilePath?
I think because your adx variable at that moment is nil. Could you please check it.
|
|
Uwe
Guest
|
When does your component initialize?
I think it's <>nil because other functions work well with the adx-reference. And I do not assign it again later.
--Uwe
|
|
Dmitry Kostochko
Add-in Express team
Posts: 2887
Joined: 2004-04-05
|
Hi Uwe,
When does your component initialize?
Before calling the OnAddInInitialize event handler.
I think it's <>nil because other functions work well with the adx-reference.
Please check it.
|
|