【dll问题】Undeclared identifier: 'Handle'怎么回事?

xiaoxinpaigu 2007-07-13 12:15:39
我在写个dll文件,它显示我Wnd:=Handle;有错误,是不是少了哪个uses啊?请高手们指教,谢谢!


library Project1;

{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }

uses
SysUtils,
Dialogs,
Forms,
ShellApi,
Windows,
StdCtrls,
FileCtrl,
Controls,
Classes;

{$R *.res}


procedure project;stdcall;
var
Old,New : string;
dou,i : integer;
TxtList:TStringList;
del : TSHFileOpStruct;
p : string;
begin

TxtList:=TStringList.Create;
TxtList.LoadFromFile('setup.txt');
for I := 0 to TxtList.Count - 1 do
begin
//复制功能
dou := pos(',',TxtList.Strings[i]);
Old := copy(TxtList.Strings[i],1,dou-1);
New := copy(TxtList.Strings[i],dou+1,length(TxtList.Strings[i])-dou);

copyfile(Pchar(Old),Pchar(New),false);
//删除功能
if copy(TxtList.Strings[i],1,4) = 'del ' then
begin
{$REGION '删除功能'}

p := copy(TxtList.Strings[i],5,(length(TxtList.Strings[i])-5));

with del do
//删除文件夹
begin
Wnd:=Handle;
pFrom :=pchar(p);
wFunc :=FO_DELETE ;
fFlags:=FOF_NOCONFIRMATION++FOF_NOCONFIRMMKDIR ;
end;
SHFileOperation(del);

//创建文件夹
if not DirectoryExists(p) then
if not CreateDir(p) then
raise Exception.Create('Cannot create '+p);

{$ENDREGION}
end;
end;
TxtList.Free;

end;


exports
project ;

begin
end.
...全文
662 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
logne 2007-07-13
  • 打赏
  • 举报
回复
你的handel哪来的呀,这不是在窗体里,可以直接调用self的handle
xiaoxinpaigu 2007-07-13
  • 打赏
  • 举报
回复
我把 Wnd:=Handle; 改成 Wnd:=0;就OK了

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧