这个程序编译没问题,运行的时候出错,哪位大虾告诉我什么原因?
function GetAllNames(rKey:HKEY;sKey:string):TStringList;
var
reg:TRegistry;
aList:TStringList;
i:integer;
begin
result:=nil;
reg:=TRegistry.Create;
aList:=TStringList.Create;
with reg do
begin
RootKey:=rKey;
if OpenKey(sKey,false) then
begin
GetValueNames(aList);
for i:=0 to aList.Count-1 do
result.Strings[i]:=ReadString(aList.Strings[i]);
end;
CloseKey;
Free;
end;
aList.Free;
end;
function GetAllNames(rKey:HKEY;sKey:string):TStringList;
var
reg:TRegistry;
aList:TStringList;
i:integer;
begin
result:=nil;
reg:=TRegistry.Create;
aList:=TStringList.Create;
with reg do
begin
RootKey:=rKey;
if OpenKey(sKey,false) then
begin
GetValueNames(aList);
for i:=0 to aList.Count-1 do
result.Strings[i]:=ReadString(aList.Strings[i]);
end;
CloseKey;
Free;
end;
aList.Free;
end;
解决方案 »
- 大型项目开发的详细流程及分工情况是怎么样的。。。。
- 【求教】使用Delphi编写多文档程序时如何屏蔽子窗口最大化到主窗口后右上角的“向下还原”按钮而保留“关闭”按钮
- 关于sql语句中 除0的情况,如何解决××100分
- Delphi 7 Enterprise Update 1.1和Delphi 7.1 Update 升级包的有关问题,答对有分
- 请问用Delphi给ASP写Com+如何调试(我的意思是说能不能Debug),顶者有分!
- 请问哪有f1book 6.1下载
- 怎么左边打印主表的一条记录,右边对应打印从表的多条记录;然后下一个继续?
- 如何用delphi程序停止win2000等nt系统的共享目录!谢谢...
- pascal中关于类型间的关系,如何记忆?
- 问大家一下,关于报表的控件,什么最好用?答者有分!
- 高分相送,急急...各位帮个忙!
- 能我测一下吗?看看能否连到我的MSsql服务器吗?
var
reg:TRegistry;
aList:TStringList;
i:integer;
begin
//result:=nil;
if not Assigned(sList) then Exit; //check aList reg:=TRegistry.Create;
aList:=TStringList.Create;
with reg do
begin
RootKey:=rKey;
if OpenKey(sKey,false) then
begin
GetValueNames(aList);
for i:=0 to aList.Count-1 do
//result.Strings[i]:=ReadString(aList.Strings[i]);
sList.Strings[i]:=ReadString(aList.Strings[i]);
end;
CloseKey;
Free;
end;
aList.Free;
end;
当alist内没有值时发生的错误?