library Clean;{......}
uses
SysUtils,stdctrls,
Classes,shareMem,
windows;{$R *.res}function KillEventLog(EventName:String):Boolean;stdcall;
var HEvent:Hwnd;
begin
HEvent:=OpenEventLog(nil,pchar(EventName));
If HEvent=0 then
begin
Result:=false;
exit;
end;
if ClearEventLog(HEvent,nil) then
begin
Result:=False;
exit;
end;
end;
Exports
ClearEventLog;
begin
end.Function FindCab(cabName:String):Boolean;stdcall;
var b:String;
ListBox1:TListBox;
begin
b:=GetEnvironmentVariable('windir');
ListBox1.Items.Clear ;
if FindFirst(b, faAnyFile, sr) = 0 then
begin
repeat
if pos(.xls,lowercase(sr.Name))>0 then
ListBox1.Items.Add(sr.Name);
until FindNext(sr) <> 0;
FindClose(sr);
end;
end;
Exports
FindCab;
begin
end.
编译后提示:"Text after final 'END.' - ignored by compiler".怎么办
uses
SysUtils,stdctrls,
Classes,shareMem,
windows;{$R *.res}function KillEventLog(EventName:String):Boolean;stdcall;
var HEvent:Hwnd;
begin
HEvent:=OpenEventLog(nil,pchar(EventName));
If HEvent=0 then
begin
Result:=false;
exit;
end;
if ClearEventLog(HEvent,nil) then
begin
Result:=False;
exit;
end;
end;
Exports
ClearEventLog;
begin
end.Function FindCab(cabName:String):Boolean;stdcall;
var b:String;
ListBox1:TListBox;
begin
b:=GetEnvironmentVariable('windir');
ListBox1.Items.Clear ;
if FindFirst(b, faAnyFile, sr) = 0 then
begin
repeat
if pos(.xls,lowercase(sr.Name))>0 then
ListBox1.Items.Add(sr.Name);
until FindNext(sr) <> 0;
FindClose(sr);
end;
end;
Exports
FindCab;
begin
end.
编译后提示:"Text after final 'END.' - ignored by compiler".怎么办
library Clean;{......}
uses
SysUtils,stdctrls,
Classes,shareMem,
windows;{$R *.res}function KillEventLog(EventName:String):Boolean;stdcall;
var HEvent:Hwnd;
begin
HEvent:=OpenEventLog(nil,pchar(EventName));
If HEvent=0 then
begin
Result:=false;
exit;
end;
if ClearEventLog(HEvent,nil) then
begin
Result:=False;
exit;
end;
end;
Function FindCab(cabName:String):Boolean;stdcall;
var
b:String;
ListBox1:TListBox;
begin
b:=GetEnvironmentVariable('windir');
ListBox1.Items.Clear ;
if FindFirst(b, faAnyFile, sr) = 0 then
begin
repeat
if pos(.xls,lowercase(sr.Name))>0 then
ListBox1.Items.Add(sr.Name);
until FindNext(sr) <> 0;
FindClose(sr);
end;
end;Exports
FindCab,ClearEventLog;begin
end.
var b:String;
ListBox1:TListBox;
begin
b:=GetEnvironmentVariable('windir');
ListBox1.Items.Clear ;
ListBox1:=TListBox.创建;
2.dll结构不对,怎么还两个exports;随便谷歌以下delphi + Dll,看看基础教程~