var
a:tregistry;
b:tstrings;
begin
a:=tregistry.Create;
a.RootKey:=HKEY_CURRENT_USER;
a.OpenKey('software\microsoft\office\10.0\common\open find\places\standardplaces',false);
b:=tstrings.Create;
a.GetKeyNames(b);
end;

解决方案 »

  1.   

    var
    a:tregistry;
    b:tstrings;
    begin
    a:=tregistry.Create;
    a.RootKey:=HKEY_CURRENT_USER;
    a.OpenKey('software\microsoft\office\10.0\common\open find\places\standardplaces',false); //
    b:=tstringList.Create;  //
    a.GetKeyNames(b);
    end;
      

  2.   

    哪有在打开WINDOWS的键值时候使用UNIX的反斜杠“/”的呢,应该用"\"
      

  3.   

    tstrings是抽象类,不能直接CREATE!使用时要小心
      

  4.   

    var
    a:tregistry;
    b:tstrings;
    begin
    a:=tregistry.Create;
    a.RootKey:=HKEY_CURRENT_USER;
    a.OpenKey('software\microsoft\office\10.0\common\open find\places\standardplaces',false);
    b:=tstrings.Create;
    a.GetKeyNames(b);
    a.free;
    end;
      

  5.   

    var
    a:tregistry;
    b:tstrings;
    begin
    a:=tregistry.Create;
    a.RootKey:=HKEY_CURRENT_USER;
    a.OpenKey('software\microsoft\office\10.0\common\open find\places\standardplaces',false);
    b:=tstrings.Create;
    a.GetKeyNames(b);
    a.free;
    end;
      

  6.   

    b:tstrings;改为tstringlist然后用b:=tstringList.Create;
      

  7.   

    楼上的正确:TStrings是个虚类,你只能用它的子类TStringList