Autor Beitrag
zakoon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 60



BeitragVerfasst: Sa 08.11.08 10:58 
Hallo zusammen,

Ich möchte zur Laufzeit einen TTimer mit OnTimerEvent erstellen.
Allerdings bringt mir der Compiler folgenden Fehler:

[DCC Fehler] XDockletSrc.pas(13): E2065 Ungenügende Forward- oder External-Deklaration: 'TXDocklet.DoOnTimer'

Irgendetwas mache ich also bei der Deklaration falsch, aber ich sehe es leider nicht.

Kann mir jemand helfen? Vielen Dank!

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
unit XDockletSrc;

interface

uses
  Windows, Registry, SysUtils, Forms, Dialogs, GDIPAPI, ShellAPI,
  ShlObj, Graphics, PictureConvert, ExtCtrls;
  
type
  TXDocklet = class
  private
    FTimer: TTimer;
    procedure DoOnTimer(Sender: TObject); // <------ Fehler 
  public
    [...] 
  end;
 [...]
function X_OnExec(Index: Integer): Boolean stdcall;
[...]
implementation

var
  XDocklet: TXDocklet;
[...]

procedure DoOnTimer(Sender:TObject);
begin
  beep;
end;

function X_OnExec(Index: Integer): Boolean;
begin
  XDocklet.FTimer := TTimer.Create(NIL);
  XDocklet.FTimer.Interval := 1500;
  XDocklet.FTimer.OnTimer := XDocklet.DoOnTimer;
  Result := True;
end;
Dunkel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 682

Mac OS X Snow Leopard
Xcode 3.1
BeitragVerfasst: Sa 08.11.08 11:49 
Hallo!

Die Procedure musst Du zu einer Methode machen!


ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TXDocklet.DoOnTimer(Sender:TObject);
begin
  beep;
end;

_________________
Ich streite einsam mich mit dieser Oberflächenwelt
Gutes sei ein löblich Brot von dem ich zehre - bis zum Tod [Das Ich - Im Ich]
zakoon Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 60



BeitragVerfasst: Sa 08.11.08 17:54 
user profile iconDunkel hat folgendes geschrieben Zum zitierten Posting springen:
Hallo!

Die Procedure musst Du zu einer Methode machen!


ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TXDocklet.DoOnTimer(Sender:TObject);
begin
  beep;
end;


Ach herrje, natürlich! Danke dir! :-)