老是提示"Unsatisfied forward or external declaration: 'TForm1.executefile'",这参数要怎么写啊!
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,shellapi;type
TForm1 = class(TForm)
zj: TComboBox;
gq: TComboBox;
Label1: TLabel;
Label2: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure zjChange(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
function executefile(const filename,params,defaultdir:string;showcmd:integer):Thandle;
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
filename,path:string;
implementation
{$R *.dfm}
procedure TForm1.zjChange(Sender: TObject);
begin
case zj.ItemIndex of
0,1,2:path:='h:\a'+inttostr(zj.ItemIndex +1);
3,4,5:path:='h:\b'+inttostr(zj.ItemIndex +1);
end;
filename:=inttostr(zj.itemindex+1)+'.txt';
gq.Items.LoadFromFile (filename);
gq.Text:=gq.Items.Strings [0];
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
case gq.ItemIndex of
0,1,2:filename:=path+'\'+'0'+inttostr(gq.ItemIndex +1)+'.mp3';
3,4,5:filename:=path+'\'+'mp3';
else
filename:=path+'\a.mp3';
end;
executefile('wmplayer.exe','','C:\Program Files\Windows Media Player ',sw_hide);
end;
function executefile(const filename,params,defaultdir:string;showcmd:integer):Thandle;
var
zfilename,zparams,zdir:array[0..5] of char;
begin
result:=shellexecute(application.MainForm .handle,nil,
strpcopy(zfilename,filename),strpcopy(zparams,params),
strpcopy(zdir,defaultdir),showcmd);
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
close;
end;end.
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,shellapi;type
TForm1 = class(TForm)
zj: TComboBox;
gq: TComboBox;
Label1: TLabel;
Label2: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure zjChange(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
function executefile(const filename,params,defaultdir:string;showcmd:integer):Thandle;
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
filename,path:string;
implementation
{$R *.dfm}
procedure TForm1.zjChange(Sender: TObject);
begin
case zj.ItemIndex of
0,1,2:path:='h:\a'+inttostr(zj.ItemIndex +1);
3,4,5:path:='h:\b'+inttostr(zj.ItemIndex +1);
end;
filename:=inttostr(zj.itemindex+1)+'.txt';
gq.Items.LoadFromFile (filename);
gq.Text:=gq.Items.Strings [0];
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
case gq.ItemIndex of
0,1,2:filename:=path+'\'+'0'+inttostr(gq.ItemIndex +1)+'.mp3';
3,4,5:filename:=path+'\'+'mp3';
else
filename:=path+'\a.mp3';
end;
executefile('wmplayer.exe','','C:\Program Files\Windows Media Player ',sw_hide);
end;
function executefile(const filename,params,defaultdir:string;showcmd:integer):Thandle;
var
zfilename,zparams,zdir:array[0..5] of char;
begin
result:=shellexecute(application.MainForm .handle,nil,
strpcopy(zfilename,filename),strpcopy(zparams,params),
strpcopy(zdir,defaultdir),showcmd);
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
close;
end;end.
解决方案 »
- 北京找工作历险记!
- 谁有外挂开发的教程?
- 紧急求救!!!怎样把txt文件和sqlserver数据库文件互相转换啊?
- 一个老菜鸟的问题
- ●● 哪里有OpenGL控件下载 ●●
- 板材分割算法
- 怎样将ListView1组件中StateImage1关联的图标显示在Column上字符串的右边,而不是系统默认的左边!
- 请问如何从网站中保存一些IMAGE,FLASH 在本地硬盘上?我指的用CODE实视!
- 左晚下载了delphi6,刚装好,猛一看确实加了好多东西,但更增加了我的迷茫,这么多新东西怎么去掌握,是否有了较好的参考资料和书籍?
- 请问怎样在MDI的命令中关闭子窗体?
- 低调不成,反被揭发
- 招delphi工程師(廣州)
function TForm1.executefile(const filename,params,defaultdir:string;showcmd:integer):Thandle;
var
zfilename,zparams,zdir:array[0..5] of char;
begin
……
end;
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons,shellapi;type
TForm1 = class(TForm)
zj: TComboBox;
gq: TComboBox;
Label1: TLabel;
Label2: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure zjChange(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
function executefile(const filename,params,defaultdir:string;showcmd:integer):Thandle;
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
filename,path:string;
implementation
{$R *.dfm}
procedure TForm1.zjChange(Sender: TObject);
begin
case zj.ItemIndex of
0,1,2:path:='h:\a'+inttostr(zj.ItemIndex +1);
3,4,5:path:='h:\b'+inttostr(zj.ItemIndex +1);
end;
filename:=inttostr(zj.itemindex+1)+'.txt';
gq.Items.LoadFromFile (filename);
gq.Text:=gq.Items.Strings [0];
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
case gq.ItemIndex of
0,1,2:filename:=path+'\'+'0'+inttostr(gq.ItemIndex +1)+'.mp3';
3,4,5:filename:=path+'\'+'mp3';
else
filename:=path+'\a.mp3';
end;
executefile('wmplayer.exe','','C:\Program Files\Windows Media Player ',sw_hide);
end;
function Tform1.executefile(const filename,params,defaultdir:string;showcmd:integer):Thandle;
var
zfilename,zparams,zdir:array[0..5] of char;
begin
result:=shellexecute(application.MainForm .handle,nil,
strpcopy(zfilename,filename),strpcopy(zparams,params),
strpcopy(zdir,defaultdir),showcmd);
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
close;
end;end.