The main problem here is the declaration of idlehandler. Application.OnIdle requires a 
pointer to a Method, not a procedure. so although you dont want to attach the event to 
the mainform, you still have to attach it to an object. any object.

you just need a local object, create one instance in the dpr, before the main block, 
destroy after

type
  TIdleHandler = class(TObject)
    procedure IdleHandler(Sender: TObject; var Done: Boolean);  
  end;

  procedure TIdleHandler.IdleHandler(Sender: TObject; var Done: Boolean);
  begin
    if mainform.ReadyForStealth then Mainform.StealthNow('');
    mainform.ReadyForStealth := false;
  end;

-----Original Message-----
From: Alistair George [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 April 2003 1:18 p.m.
To: Multiple recipients of list delphi
Subject: [DUG]: Idle event


Hello Jeremy,
Several errors due to wrongly placing code as I have not used a DPR file before:

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';

procedure IdleHandler(Sender: TObject; var Done: Boolean);
{$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(32): 
Incompatible
types: method pointer and regular procedure
  Application.run;

end;
end.

end.
-- 
Regards,
 Alistair+

---------------------------------------------------------------------------
    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/
---------------------------------------------------------------------------
    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/

Reply via email to