Как узнать доступен ли DCOM?

Previous  Top  Next

    
 

 

 

Code:

function IsDCOMEnabled: Boolean;

var

Ts: string;

R: TRegistry;

begin

r := TRegistry.Create;

r.RootKey := HKEY_LOCAL_MACHINE;

r.OpenKey('Software\Microsoft\OLE', False);

ts := AnsiUpperCase(R.ReadString('EnableDCOM'));

r.Free;

Result := (Ts = 'Y');

end;

 

 

©Drkb::04328

Взято с Delphi Knowledge Base: http://www.baltsoft.com/


Code:

function IsDCOMInstalled: Boolean;

var

OLE32: HModule;

begin

Result := not (IsWin95 or IsWin95OSR2);

if not Result then

begin

   OLE32 := LoadLibrary(COLE32DLL);

   if OLE32 > 0 then

   try

     Result := GetProcAddress(OLE32, PChar('CoCreateInstanceEx')) <> nil;

   finally

     FreeLibrary(OLE32);

   end;

end;

end;

 

 

©Drkb::04329

Взято с Delphi Knowledge Base: http://www.baltsoft.com/