2012-03-23 22 views

回答

6

如果CLSID在使用CLSIDFromProgID功能存在于注册表中,您可以检查,对MSXML的CLSID是Msxml2.DOMDocument.6.0

入住此示例应用程序

uses 
    ActiveX, 
    SysUtils; 

{ 
     Msxml2.DOMDocument.2.6 
     Msxml2.DOMDocument.3.0 
     Msxml2.DOMDocument.4.0 
     Msxml2.DOMDocument.5.0 
     Msxml2.DOMDocument.6.0 
} 
var 
    clsid: TCLSID; 
begin 
    try 
    if Succeeded(CLSIDFromProgID('Msxml2.DOMDocument.6.0', clsid)) then 
    Writeln('MSXML 6.0 Installed') 
    else 
    Writeln('MSXML 6.0 Not Installed'); 
    except 
    on E: Exception do 
     Writeln(E.ClassName, ': ', E.Message); 
    end; 
    Readln; 
end. 
+2

这只会告诉你,如果CLSID存在于注册表中,而不是MSXML本身是否实际运行正常。要做到这一点,你必须通过'CoCreateInstance()'实例化它。 – 2012-03-23 22:24:20

+1

@RemyLebeau,的确,OP可以将一个调用添加到'CoCreateInstance'函数中。 – RRUZ 2012-03-24 00:37:34

相关问题