FilePath

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

FilePath
 
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

Posted 24 Apr, 2005 10:53:25 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
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.

Posted 25 Apr, 2005 06:56:39 Top
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
Posted 26 Apr, 2005 13:05:01 Top
Dmitry Kostochko


Add-in Express team


Posts: 2740
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.

Posted 27 Apr, 2005 02:24:50 Top