procedure AddAllIcoInFile(pFilePath:string;img1:timagelist);
var
i:integer;j:integer;
pOleVariant:OleVariant;
pFolderCount:integer;pFileCount:integer;
pFileSystemObject:tFileSystemObject; pDrive:idrive;
pFolder:iFolder; pFoldercollection:Folders;pLoopFolder:iFolder ;
pFile:iFile; pFileCollection:ifilecollection;
begin pFileSystemObject:=tFileSystemObject.Create(nil) ;
pFolder:=pFileSystemObject.DefaultInterface.GetFolder(pFilePath) ;
pFoldercollection:=pFolder.SubFolders ;
pFileCollection:=pFolder.Files ;
pFolderCount:= pFoldercollection.Count;
pFileCount:=pFolder.Files.Count ;
i:=0;
pOleVariant:= pFileCollection.Count-1 ;
try
pLoopFolder:= pFoldercollection.Item
pFile:=CoFile_.Create ;
pFile :=pFileCollection.Item[polevariant];//为什么总是在这个地方提示参数不真确啊?我调试过了 polevariant和pFileCollection.count都有值,而且正确;请问怎么填写这个参数啊?
showmessage(pfile.Name ) ;
except
messagebox(0,'参数错误!!!','错误提示:',MB_YESNO +MB_ICONEXCLAMATION);
msgstring:='';
end;
exit;
while i<pFolderCount do
begin
if i=0 then msgstring:=( '文件夹共有:'+ inttostr(pFolderCount)+'个' );
if msgstring='' then msgString:=' '+pFoldercollection.Item[i].Name
else msgstring:=msgstring+#13+ ' '+pFoldercollection.Item[i].Name;
i:=i+1;
end;
end;
var
i:integer;j:integer;
pOleVariant:OleVariant;
pFolderCount:integer;pFileCount:integer;
pFileSystemObject:tFileSystemObject; pDrive:idrive;
pFolder:iFolder; pFoldercollection:Folders;pLoopFolder:iFolder ;
pFile:iFile; pFileCollection:ifilecollection;
begin pFileSystemObject:=tFileSystemObject.Create(nil) ;
pFolder:=pFileSystemObject.DefaultInterface.GetFolder(pFilePath) ;
pFoldercollection:=pFolder.SubFolders ;
pFileCollection:=pFolder.Files ;
pFolderCount:= pFoldercollection.Count;
pFileCount:=pFolder.Files.Count ;
i:=0;
pOleVariant:= pFileCollection.Count-1 ;
try
pLoopFolder:= pFoldercollection.Item
pFile:=CoFile_.Create ;
pFile :=pFileCollection.Item[polevariant];//为什么总是在这个地方提示参数不真确啊?我调试过了 polevariant和pFileCollection.count都有值,而且正确;请问怎么填写这个参数啊?
showmessage(pfile.Name ) ;
except
messagebox(0,'参数错误!!!','错误提示:',MB_YESNO +MB_ICONEXCLAMATION);
msgstring:='';
end;
exit;
while i<pFolderCount do
begin
if i=0 then msgstring:=( '文件夹共有:'+ inttostr(pFolderCount)+'个' );
if msgstring='' then msgString:=' '+pFoldercollection.Item[i].Name
else msgstring:=msgstring+#13+ ' '+pFoldercollection.Item[i].Name;
i:=i+1;
end;
end;
解决方案 »
- 请问个字符串 控制方面的问题
- 哪位大虾用过五岳鑫的语音卡,提供一下Delphi6.0的代码,谢谢!!!
- 高分求一控件下载地址,在线等!
- intrawen & rave update pack
- 想写一个可以随意设计表单的程序,大家给点思路吧
- fastreport 用footer的onbeforprint写脚本的方法实现空行打印后,footer本身内部的sum函数等无法显示了?
- 在线求教,如何在DELPHI中调用EXCEL生成图表,并设置其属性及方法?
- 在C++Builder中调用没有被宝兰封装的API怎么办?
- 在DELPHI中同PB的RETURN语句功能相同的语句是什么?即不再执行下面语句
- TStoreProc中可不可以使用ftBlob类型的参数?
- 在线急等:用insert into怎么才能把sql server中的部分内容批处理到sql server之外,成为一个单独的文件
- 关于delphi调用vc中奇怪的错误
多测试一下,应该是整型或者字符串类型.
pFileCollection 是 iFileCollection;这是个文件集合接口;这个Dll好像是WINDOWS系统自带的库吧;再VB里是很好用的;我现在把它翻译打DEPHI里不知道这个地方应该怎么填?我试过了直接填一个数字不行;最郁闷的是我测试时候 pFileCollection.count还有值,而且正确;???