怎么得到本地计算机上己注册的所有的COM的GUID?(200分)

  • 主题发起人 主题发起人 dedema
  • 开始时间 开始时间
我自己来UP
 
我再自己来UP
 
我再自己来UP
 
tseug不是早就帮你解决了吗?
看一下下面的代码:(来自http://www.techvanguards.com ,EventSinkParser )
procedure ReadTypeLib (reg: TRegistry;
const sLibId, sLibVersion: string);
var
sSubkey, sLibDescription, sLibFile: string;
lstSubkeys: TStringList;
rtl: TRegTypeLib;
i: integer;
begin
Assert (reg <> nil);
lstSubKeys := TStringList.Create;
try
with regdo
begin
if not (OpenKey ('TypeLib/' + sLibId + '/' + sLibVersion, FALSE)) then
Exit;
sLibDescription := ReadString ('');
{ load subkeys and parse out for numeric with a win32 subkey }
GetKeyNames (lstSubKeys);
CloseKey;
for i := 0 to lstSubKeys.Count - 1do
begin
sSubkey := lstSubkeys ;
if (sSubKey = '') then
Continue;
if not (sSubkey [1] in ['0'..'9']) then
Continue;
{ win32 }
if not (OpenKey ('TypeLib/' + sLibId + '/' + sLibVersion + '/' + sSubKey + '/win32', FALSE)) then
Continue;
sLibFile := ReadString ('');
CloseKey;
//if not (FileExists (sLibFile)) then
Continue;
{ add item }
rtl := TRegTypeLib.Create;
rtl.Filename := sLibFile;
rtl.Description := Format ('%s (version %s)', [sLibDescription, sLibVersion]);
FItems.Add (rtl);
Break;
end;
{ for }
end;
{ with }
finally
lstSubKeys.Free;
end;
{ finally }
end;
 
多人接受答案了。
 

Similar threads

回复
0
查看
848
不得闲
回复
0
查看
812
不得闲
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
后退
顶部