change this;
> procedure IdleHandler(Sender: TObject; var Done: Boolean);
> begin
> if mainform.ReadyForStealth then Mainform.StealthNow('');
> mainform.ReadyForStealth := false;
> end;
to
procedure TIdleHandler.IdleHandler(Sender: TObject; var Done: Boolean);
begin
if mainform.ReadyForStealth then Mainform.StealthNow('');
mainform.ReadyForStealth := false;
end;
and
> Application.OnIdle := IdleHandler; //[Error]
to
lIdleHandler := TIdleHandler.Create;
Application.OnIdle := lIdleHandler.IdleHandler; //[Error]
perhaps you should descend the TIdleHandler class from TCOmponent
so you can give it an owner (ie Application) and then it will be destroyed.
alternatively you could move your IdleHandler procedure into the main form.
Add it to the public section and do this in the dpr... (I would do it this
way).
Where were you trying to assign the OnIdle event in main form originally?
FormCreate?
> Application.OnIdle := MainForm.IdleHandler; //[Error]
JED
[EMAIL PROTECTED] wrote on 02/04/2003 02:58:40 PM:
> Hello Kyley,
>
> Thanks, but still not compiling:
>
> program back4winXP;
>
> uses
> Forms,
> dialogs,
> mainunit in 'mainunit.pas' {Mainform},
> b4winabt in 'b4winabt.pas' {b4winForm},
> regunit in 'regunit.pas' {RegForm},
> Password in 'password.pas' {PasswordDlg},
> mb in 'mb.pas',
> SortGrid in 'SortGrid.pas',
> Updater in '..\..\mylib\Updater.pas',
> VCLZip in '..\..\mylib\ZIP\VCLzip\VCLZip.pas',
> VCLUnZip in '..\..\mylib\ZIP\VCLzip\VCLUnZip.pas',
> Sshare in '..\..\Lib\Additional\Sshare.pas';
> type
> TIdleHandler = class(TObject)
> procedure IdleHandler(Sender: TObject; var Done: Boolean);
> //[Error] back4winXP.dpr(18): Unsatisfied forward or external
> declaration: 'TIdleHandler.IdleHandler'
> end;
>
> {$R *.RES}
>
> procedure IdleHandler(Sender: TObject; var Done: Boolean);
> begin
> if mainform.ReadyForStealth then Mainform.StealthNow('');
> mainform.ReadyForStealth := false;
> end;
>
> begin
> Application.Initialize;
> Application.Title := 'Back4WinXP';
> Application.HelpFile := 'back4winxp.hlp';
> Application.ShowMainForm := False;
> Application.CreateForm(TMainform, Mainform);
> Application.OnIdle := IdleHandler; //[Error]
> back4winXP.dpr(35): Incompatible types: method pointer and regular
procedure
> Application.run;
> end.
>
>
---------------------------------------------------------------------------
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
> Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the [EMAIL PROTECTED]
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/