unit mainform;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ActnList, Menus, ExtCtrls, ComCtrls, ImgList, ToolWin, FileCtrl,
StdCtrls, ExtDlgs,SlideSetForm,ShellAPI,Jpeg;type
TViewForm = class(TForm)
Open1: TAction;
SaveAs1: TAction;
Cut1: TAction;
Print1: TAction;
.
.
.
Label2: TLabel;
DirectoryListBox1: TDirectoryListBox;
Splitter1: TSplitter;
PopupMenu1: TPopupMenu;
N33: TMenuItem;
X3: TMenuItem;
OPD: TOpenDialog;
SavePic: TSavePictureDialog;
PrintDialog1: TPrintDialog;
PrinterSetupDialog1: TPrinterSetupDialog;
Timer1: TTimer;
Splitter2: TSplitter;
procedure FormCreate(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure Exit1Execute(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure Splitter2Moved(Sender: TObject);
procedure Open1Execute(Sender: TObject);
private
procedure DoLoad(const FileName: String);
{ Private declarations }
public
{ Public declarations }
end;
Function GetImgList(Sender:TObject):Boolean; var
ViewForm: TViewForm;
tmpBitmap:Tbitmap;
iBitmapValide:Boolean;
FileExt:string[4];
JPEGImage:TJPEGImage;
WinWidth,WinHeight,WinLeft,WinTop:Integer;//窗口大小位置
FileIndex:Integer;
FileNum:Integer;
Circulation:Boolean;
//用于图片漫游
Origin:Tpoint;
ImageLeft:integer;
ImageTop:Integer;
Visa1:Tpoint;
VIsa2:Tpoint;
Canmove:boolean;
hm:HMENU;implementationprocedure TViewForm.Open1Execute(Sender: TObject);
begin
if OPD.Execute then
begin
Doload(OPD.FileName);
StatusBar1.Panels[1].Text:=OPD.FileName;
GetImgList(Sender);
end;
end;上面代码中函数Function GetImgList(Sender:TObject):Boolean;怎么可以在那里定义,在别人的程序里可以通过编译,在我的程序里就不行呢?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ActnList, Menus, ExtCtrls, ComCtrls, ImgList, ToolWin, FileCtrl,
StdCtrls, ExtDlgs,SlideSetForm,ShellAPI,Jpeg;type
TViewForm = class(TForm)
Open1: TAction;
SaveAs1: TAction;
Cut1: TAction;
Print1: TAction;
.
.
.
Label2: TLabel;
DirectoryListBox1: TDirectoryListBox;
Splitter1: TSplitter;
PopupMenu1: TPopupMenu;
N33: TMenuItem;
X3: TMenuItem;
OPD: TOpenDialog;
SavePic: TSavePictureDialog;
PrintDialog1: TPrintDialog;
PrinterSetupDialog1: TPrinterSetupDialog;
Timer1: TTimer;
Splitter2: TSplitter;
procedure FormCreate(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure Exit1Execute(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure Splitter2Moved(Sender: TObject);
procedure Open1Execute(Sender: TObject);
private
procedure DoLoad(const FileName: String);
{ Private declarations }
public
{ Public declarations }
end;
Function GetImgList(Sender:TObject):Boolean; var
ViewForm: TViewForm;
tmpBitmap:Tbitmap;
iBitmapValide:Boolean;
FileExt:string[4];
JPEGImage:TJPEGImage;
WinWidth,WinHeight,WinLeft,WinTop:Integer;//窗口大小位置
FileIndex:Integer;
FileNum:Integer;
Circulation:Boolean;
//用于图片漫游
Origin:Tpoint;
ImageLeft:integer;
ImageTop:Integer;
Visa1:Tpoint;
VIsa2:Tpoint;
Canmove:boolean;
hm:HMENU;implementationprocedure TViewForm.Open1Execute(Sender: TObject);
begin
if OPD.Execute then
begin
Doload(OPD.FileName);
StatusBar1.Panels[1].Text:=OPD.FileName;
GetImgList(Sender);
end;
end;上面代码中函数Function GetImgList(Sender:TObject):Boolean;怎么可以在那里定义,在别人的程序里可以通过编译,在我的程序里就不行呢?
解决方案 »
- dbchart为什么有的有数标有的没有?
- 怎么实现不规则图形的3d显示,就像按钮一样凸起
- Delphi调用VC版COM接口函数抛异常
- 学写学习再学习
- DBCtrlGrid1-与动态绑定控键
- 求一多線程數據計算算法.100分.
- 如果像d6自带数据库一样,一个database下有几个表,能用dbe吗?在哪建库(包含多个表)
- 如何在DBlistBox1.items查找第一个字母等于A的值呢?
- 关于取整和取余数。
- 高分求说法!!!从DOS->WINDOWS具体哪些方面得到了重大改变!!!!(200分)
- 超级郁闷,怎样设置打印机纸张的大小(类型),找了好多资料,大多让我从控制面板中设置,太不可思议了
- 关于线程的问题,高手请进!
定义在那里是普通的全局函数阿
你报的什么错呢?
[Error] mainform.pas(160): Unsatisfied forward or external declaration: 'GetImgList'
[Fatal Error] Graphishow.dpr(6): Could not compile used unit 'mainform.pas'
TViewForm = class(TForm)
{...}
public
Function GetImgList(Sender:TObject):Boolean; //注意位置
{ Public declarations }
end;
implementationprocedure TViewForm.Open1Execute(Sender: TObject);
begin
{...}
end;説明:你的函数定义要放在TViewForm定义中.
begin
Result := True;
end;