今天在FDS建模程序编写时自定义了一组鼠标响应事件,结果总是提示“Unsatisfied forward or external declaration”错误,最终发现是如下原因造成的:
类声明部分定义的procedure PanelClick(Sender:Tobjcet),在实现部分需要有类名的全称!
1 type
2 TForm1 = class(TForm)
3 ...
4 procedure PanelClick(Sender:Tobjcet); //过程声明
5
6 private
7 { Private declarations }
8 public
9 { Public declarations }
10 end;
11
12 var
13 Form1: TForm1;
14
15 implementation
16
17 {$R *.dfm}
18 procedure PanelClick(Sender:Tobjcet); //Error,出错了!
19 ...
20
21
22
23 procedure TForm1.PanelClick(Sender:Tobjcet); //只需加个TForm1就OK了呵呵!
24 ...
25
26