请问老大,下面程序如何出现错误? (100分)

  • 主题发起人 主题发起人 cyberwalker
  • 开始时间 开始时间
C

cyberwalker

Unregistered / Unconfirmed
GUEST, unregistred user!
请问老大,下面程序如何出现错误?<br>type<br>&nbsp; PShellItem = ^TShellItem;<br>&nbsp; TShellItem = record<br>&nbsp; &nbsp; FullID,<br>&nbsp; &nbsp; ID: PItemIDList;<br>&nbsp; &nbsp; IsFolder,<br>&nbsp; &nbsp; Empty: Boolean;<br>&nbsp; &nbsp; DisplayName,<br>&nbsp; &nbsp; TypeName: string;<br>&nbsp; &nbsp; ImageIndex,<br>&nbsp; &nbsp; Size,<br>&nbsp; &nbsp; Attributes: Integer;<br>&nbsp; &nbsp; ModDate: string;<br>end;<br><br>procedure TFindFlash_Main.GetRawIDList(ShellFolder: IShellFolder);<br>var<br>&nbsp; Flags: Cardinal;<br>&nbsp; ID,<br>&nbsp; FullID: PItemIDList;<br>&nbsp; EnumList: IEnumIDList;<br>&nbsp; NumIDs: LongWord;<br>&nbsp; ShellItem: PShellItem;<br>begin<br>&nbsp; Flags:= SHCONTF_FOLDERS or SHCONTF_NONFOLDERS or SHCONTF_INCLUDEHIDDEN;<br><br>&nbsp; OleCheck(<br>&nbsp; &nbsp; &nbsp;ShellFolder.EnumObjects(<br>&nbsp; &nbsp; &nbsp; &nbsp; Application.Handle,<br>&nbsp; &nbsp; &nbsp; &nbsp; Flags,<br>&nbsp; &nbsp; &nbsp; &nbsp; EnumList)<br>&nbsp; );<br><br>&nbsp; FIShellFolder := ShellFolder;<br>&nbsp; ClearRawIDList;<br><br>&nbsp; while EnumList.Next(1, ID, NumIDs) = S_OK do<br>&nbsp; begin<br>&nbsp; &nbsp; FullID:= ConcatPIDLs(FPIDL, ID); &nbsp; &nbsp;//Parent Item ID<br><br>&nbsp; &nbsp; ShellItem:= New(PShellItem);<br>&nbsp; &nbsp; ShellItem.FullID:= FullID;<br>&nbsp; &nbsp; ShellItem.ID:= ID;<br>&nbsp; &nbsp; ShellItem.DisplayName:= GetDisplayName(FIShellFolder, ID, False);<br>&nbsp; &nbsp; ShellItem.ImageIndex:= &nbsp;GetShellImage(FullID, ListView.ViewStyle = vsIcon, False);<br>&nbsp; &nbsp; ShellItem.Attributes:= &nbsp;GetShellAtt(FIShellFolder, ShellItem);<br>&nbsp; &nbsp; ShellItem.IsFolder:= &nbsp; &nbsp;IsFolder(ShellFolder,ShellItem.ID);<br>&nbsp; &nbsp; ShellItem.Empty:= True;<br>&nbsp; &nbsp; FRawIDList.Add(ShellItem);<br>&nbsp; end;<br>end;<br><br>procedure TFindFlash_Main.GetIDList;<br>var<br>&nbsp; I: Integer;<br>&nbsp; ShellItem: PShellItem;<br>begin<br>&nbsp; ClearIDList;<br>&nbsp; for I:=0 to FRawIDList.Count-1 do<br>&nbsp; begin<br>&nbsp; &nbsp; ShellItem:=RawShellItem(I);<br>&nbsp; &nbsp; if CanAdd(ShellItem) then <br>&nbsp; &nbsp; &nbsp; FIDList.Add(ShellItem);<br>&nbsp; end;<br>end;
 
"请问大大"????写错了吧?
 
//总是出现dbgBreakPoint error, 为什么?<br><br>procedure TMain.PopulateIDList(ShellFolder: IShellFolder);<br>const<br>&nbsp; Flags= SHCONTF_FOLDERS or SHCONTF_NONFOLDERS or SHCONTF_INCLUDEHIDDEN;<br>var<br>&nbsp; I: Integer;<br>&nbsp; ID: PItemIDList;<br>&nbsp; EnumList: IEnumIDList;<br>&nbsp; NumIDs: LongWord;<br>&nbsp; SaveCursor: TCursor;<br>&nbsp; ****emA,<br>&nbsp; ****emB: PShellItem;<br>begin<br>&nbsp; SaveCursor := Screen.Cursor;<br>&nbsp; try<br>&nbsp; &nbsp; Screen.Cursor := crHourglass;<br><br>&nbsp; &nbsp; OleCheck(ShellFolder.EnumObjects(Application.Handle, Flags, EnumList));<br><br>&nbsp; &nbsp; FIShellFolder := ShellFolder;<br><br>&nbsp; &nbsp; ClearIDListA;<br>&nbsp; &nbsp; ClearIDListB;<br><br>&nbsp; &nbsp; while EnumList.Next(1, ID, NumIDs) = S_OK do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; ****emA := New(PShellItem);<br>&nbsp; &nbsp; &nbsp; ****emA.ID := ID;<br>&nbsp; &nbsp; &nbsp; ****emA.DisplayName := GetDisplayName(FIShellFolder, ID, False);<br>&nbsp; &nbsp; &nbsp; ****emA.Empty := True;<br>&nbsp; &nbsp; &nbsp; FIDListA.Add(****emA);<br>&nbsp; &nbsp; end;<br><br>&nbsp; &nbsp; for I:=0 to FIDListA.Count-1 do<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; with ShellItemA(I)^ do<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; ****emB:=New(PShellItem);<br>&nbsp; &nbsp; &nbsp; &nbsp; ****emB.ID:=ID;<br>&nbsp; &nbsp; &nbsp; &nbsp; ****emB.DisplayName:=DisplayName;<br>&nbsp; &nbsp; &nbsp; &nbsp; ****emB.Empty:=****emB.Empty;<br>&nbsp; &nbsp; &nbsp; &nbsp; FIDListB.Add(****emB)<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; ListView.Items.Count := FIDListB.Count;<br>&nbsp; &nbsp; ListView.Repaint;<br>&nbsp; finally<br>&nbsp; &nbsp; Screen.Cursor := SaveCursor;<br>&nbsp; end;<br>end;<br><br>
 
后退
顶部