Entweder du instanzierst das helper object oder du musst eine Klassenmethode verwenden:
Delphi-Quellcode:
type
THelper =
class(TObject)
class procedure AddToTree(disp: IADs);
end;
var
trUser: TTreeView;
dn : IADs;
// ...
// adds the user to the chosen list
class procedure THelper.AddToTree(disp: IADs);
begin
trUser.Items.Add(
nil, disp.
Name);
end;
// set some properties for open winnt
procedure OpenProperties(
dom: IADsContainer);
begin
dom.Filter := VarArrayOf(['
user']);
ADsEnumerateObjects(
dom, THelper.AddToTree);
end;