C
cyberwalker
Unregistered / Unconfirmed
GUEST, unregistred user!
请问老大,下面程序如何出现错误?<br>type<br> PShellItem = ^TShellItem;<br> TShellItem = record<br> FullID,<br> ID: PItemIDList;<br> IsFolder,<br> Empty: Boolean;<br> DisplayName,<br> TypeName: string;<br> ImageIndex,<br> Size,<br> Attributes: Integer;<br> ModDate: string;<br>end;<br><br>procedure TFindFlash_Main.GetRawIDList(ShellFolder: IShellFolder);<br>var<br> Flags: Cardinal;<br> ID,<br> FullID: PItemIDList;<br> EnumList: IEnumIDList;<br> NumIDs: LongWord;<br> ShellItem: PShellItem;<br>begin<br> Flags:= SHCONTF_FOLDERS or SHCONTF_NONFOLDERS or SHCONTF_INCLUDEHIDDEN;<br><br> OleCheck(<br> ShellFolder.EnumObjects(<br> Application.Handle,<br> Flags,<br> EnumList)<br> );<br><br> FIShellFolder := ShellFolder;<br> ClearRawIDList;<br><br> while EnumList.Next(1, ID, NumIDs) = S_OK do<br> begin<br> FullID:= ConcatPIDLs(FPIDL, ID); //Parent Item ID<br><br> ShellItem:= New(PShellItem);<br> ShellItem.FullID:= FullID;<br> ShellItem.ID:= ID;<br> ShellItem.DisplayName:= GetDisplayName(FIShellFolder, ID, False);<br> ShellItem.ImageIndex:= GetShellImage(FullID, ListView.ViewStyle = vsIcon, False);<br> ShellItem.Attributes:= GetShellAtt(FIShellFolder, ShellItem);<br> ShellItem.IsFolder:= IsFolder(ShellFolder,ShellItem.ID);<br> ShellItem.Empty:= True;<br> FRawIDList.Add(ShellItem);<br> end;<br>end;<br><br>procedure TFindFlash_Main.GetIDList;<br>var<br> I: Integer;<br> ShellItem: PShellItem;<br>begin<br> ClearIDList;<br> for I:=0 to FRawIDList.Count-1 do<br> begin<br> ShellItem:=RawShellItem(I);<br> if CanAdd(ShellItem) then <br> FIDList.Add(ShellItem);<br> end;<br>end;