⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmadmctl.pas

📁 这是不可多得的源代码
💻 PAS
📖 第 1 页 / 共 2 页
字号:
procedure TCOMAdminCatalog.StartRouter;
begin
  DefaultInterface.StartRouter;
end;

procedure TCOMAdminCatalog.InstallMultipleComponents(const bstrApplIdOrName: WideString; 
                                                     var varFileNames: PSafeArray; 
                                                     var varCLSIDS: PSafeArray);
begin
  DefaultInterface.InstallMultipleComponents(bstrApplIdOrName, varFileNames, varCLSIDS);
end;

procedure TCOMAdminCatalog.GetMultipleComponentsInfo(const bstrApplIdOrName: WideString; 
                                                     var varFileNames: PSafeArray; 
                                                     out varCLSIDS: PSafeArray; 
                                                     out varClassNames: PSafeArray; 
                                                     out varFileFlags: PSafeArray; 
                                                     out varComponentFlags: PSafeArray);
begin
  DefaultInterface.GetMultipleComponentsInfo(bstrApplIdOrName, varFileNames, varCLSIDS, 
                                             varClassNames, varFileFlags, varComponentFlags);
end;

procedure TCOMAdminCatalog.RefreshComponents;
begin
  DefaultInterface.RefreshComponents;
end;

procedure TCOMAdminCatalog.BackupREGDB(const bstrBackupFilePath: WideString);
begin
  DefaultInterface.BackupREGDB(bstrBackupFilePath);
end;

procedure TCOMAdminCatalog.RestoreREGDB(const bstrBackupFilePath: WideString);
begin
  DefaultInterface.RestoreREGDB(bstrBackupFilePath);
end;

procedure TCOMAdminCatalog.QueryApplicationFile(const bstrApplicationFile: WideString; 
                                                out bstrApplicationName: WideString; 
                                                out bstrApplicationDescription: WideString; 
                                                out bHasUsers: WordBool; out bIsProxy: WordBool; 
                                                out varFileNames: PSafeArray);
begin
  DefaultInterface.QueryApplicationFile(bstrApplicationFile, bstrApplicationName, 
                                        bstrApplicationDescription, bHasUsers, bIsProxy, 
                                        varFileNames);
end;

procedure TCOMAdminCatalog.StartApplication(const bstrApplIdOrName: WideString);
begin
  DefaultInterface.StartApplication(bstrApplIdOrName);
end;

function  TCOMAdminCatalog.ServiceCheck(lService: Integer): Integer;
begin
  Result := DefaultInterface.ServiceCheck(lService);
end;

procedure TCOMAdminCatalog.InstallMultipleEventClasses(const bstrApplIdOrName: WideString; 
                                                       var varFileNames: PSafeArray; 
                                                       var varCLSIDS: PSafeArray);
begin
  DefaultInterface.InstallMultipleEventClasses(bstrApplIdOrName, varFileNames, varCLSIDS);
end;

procedure TCOMAdminCatalog.InstallEventClass(const bstrApplIdOrName: WideString; 
                                             const bstrDLL: WideString; const bstrTLB: WideString; 
                                             const bstrPSDLL: WideString);
begin
  DefaultInterface.InstallEventClass(bstrApplIdOrName, bstrDLL, bstrTLB, bstrPSDLL);
end;

procedure TCOMAdminCatalog.GetEventClassesForIID(const bstrIID: WideString; 
                                                 out varCLSIDS: PSafeArray; 
                                                 out varProgIDs: PSafeArray; 
                                                 out varDescriptions: PSafeArray);
begin
  DefaultInterface.GetEventClassesForIID(bstrIID, varCLSIDS, varProgIDs, varDescriptions);
end;

class function CoCOMAdminCatalogObject.Create: ICatalogObject;
begin
  Result := CreateComObject(CLASS_COMAdminCatalogObject) as ICatalogObject;
end;

procedure TCOMAdminCatalogObject.InitServerData;
const
  CServerData: TServerData = (
    ClassID:   '{F618C515-DFB8-11D1-A2CF-00805FC79235}';
    IntfIID:   '{6EB22871-8A19-11D0-81B6-00A0C9231C29}';
    EventIID:  '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

procedure TCOMAdminCatalogObject.Connect;
var
  punk: IUnknown;
begin
  if FIntf = nil then
  begin
    punk := GetServer;
    Fintf:= punk as ICatalogObject;
  end;
end;

procedure TCOMAdminCatalogObject.ConnectTo(svrIntf: ICatalogObject);
begin
  Disconnect;
  FIntf := svrIntf;
end;

procedure TCOMAdminCatalogObject.DisConnect;
begin
  if Fintf <> nil then
  begin
    FIntf := nil;
  end;
end;

function TCOMAdminCatalogObject.GetDefaultInterface: ICatalogObject;
begin
  if FIntf = nil then
    Connect;
  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  Result := FIntf;
end;

constructor TCOMAdminCatalogObject.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
end;

destructor TCOMAdminCatalogObject.Destroy;
begin
  inherited Destroy;
end;

function  TCOMAdminCatalogObject.Get_Value(const bstrPropName: WideString): OleVariant;
begin
  Result := DefaultInterface.Get_Value(bstrPropName);
end;

procedure TCOMAdminCatalogObject.Set_Value(const bstrPropName: WideString; retval: OleVariant);
begin
  DefaultInterface.Set_Value(bstrPropName, retval);
end;

function  TCOMAdminCatalogObject.Get_Key: OleVariant;
begin
  Result := DefaultInterface.Get_Key;
end;

function  TCOMAdminCatalogObject.Get_Name: OleVariant;
begin
  Result := DefaultInterface.Get_Name;
end;

function  TCOMAdminCatalogObject.Get_Valid: WordBool;
begin
  Result := DefaultInterface.Get_Valid;
end;

function  TCOMAdminCatalogObject.IsPropertyReadOnly(const bstrPropName: WideString): WordBool;
begin
  Result := DefaultInterface.IsPropertyReadOnly(bstrPropName);
end;

function  TCOMAdminCatalogObject.IsPropertyWriteOnly(const bstrPropName: WideString): WordBool;
begin
  Result := DefaultInterface.IsPropertyWriteOnly(bstrPropName);
end;

class function CoCOMAdminCatalogCollection.Create: ICatalogCollection;
begin
  Result := CreateComObject(CLASS_COMAdminCatalogCollection) as ICatalogCollection;
end;

procedure TCOMAdminCatalogCollection.InitServerData;
const
  CServerData: TServerData = (
    ClassID:   '{F618C516-DFB8-11D1-A2CF-00805FC79235}';
    IntfIID:   '{6EB22872-8A19-11D0-81B6-00A0C9231C29}';
    EventIID:  '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

procedure TCOMAdminCatalogCollection.Connect;
var
  punk: IUnknown;
begin
  if FIntf = nil then
  begin
    punk := GetServer;
    Fintf:= punk as ICatalogCollection;
  end;
end;

procedure TCOMAdminCatalogCollection.ConnectTo(svrIntf: ICatalogCollection);
begin
  Disconnect;
  FIntf := svrIntf;
end;

procedure TCOMAdminCatalogCollection.DisConnect;
begin
  if Fintf <> nil then
  begin
    FIntf := nil;
  end;
end;

function TCOMAdminCatalogCollection.GetDefaultInterface: ICatalogCollection;
begin
  if FIntf = nil then
    Connect;
  Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
  Result := FIntf;
end;

constructor TCOMAdminCatalogCollection.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
end;

destructor TCOMAdminCatalogCollection.Destroy;
begin
  inherited Destroy;
end;

function  TCOMAdminCatalogCollection.Get_Item(lIndex: Integer): TCOMAdminCatalogObject;
begin
  Result := TCOMAdminCatalogObject.Create(Self);
  Result.ConnectTo( DefaultInterface.Get_Item(lIndex) as ICatalogObject);
end;

function  TCOMAdminCatalogCollection.Get_Count: Integer;
begin
  Result := DefaultInterface.Get_Count;
end;

function  TCOMAdminCatalogCollection.Get_Name: OleVariant;
begin
  Result := DefaultInterface.Get_Name;
end;

function  TCOMAdminCatalogCollection.Get_AddEnabled: WordBool;
begin
  Result := DefaultInterface.Get_AddEnabled;
end;

function  TCOMAdminCatalogCollection.Get_RemoveEnabled: WordBool;
begin
  Result := DefaultInterface.Get_RemoveEnabled;
end;

function  TCOMAdminCatalogCollection.Get_DataStoreMajorVersion: Integer;
begin
  Result := DefaultInterface.Get_DataStoreMajorVersion;
end;

function  TCOMAdminCatalogCollection.Get_DataStoreMinorVersion: Integer;
begin
  Result := DefaultInterface.Get_DataStoreMinorVersion;
end;

procedure TCOMAdminCatalogCollection.Remove(lIndex: Integer);
begin
  DefaultInterface.Remove(lIndex);
end;

function  TCOMAdminCatalogCollection.Add: TCOMAdminCatalogObject;
begin
  Result := TCOMAdminCatalogObject.Create(Self);
  Result.ConnectTo( DefaultInterface.Add() as ICatalogObject);
end;

procedure TCOMAdminCatalogCollection.Populate;
begin
  DefaultInterface.Populate;
end;

function  TCOMAdminCatalogCollection.SaveChanges: Integer;
begin
  Result := DefaultInterface.SaveChanges;
end;

function  TCOMAdminCatalogCollection.GetCollection(const bstrCollName: WideString; 
                                                   varObjectKey: OleVariant):
                                                   TCOMAdminCatalogCollection;
begin
  Result := TCOMAdminCatalogCollection.Create(Self);
  Result.ConnectTo( DefaultInterface.GetCollection(bstrCollName, varObjectKey)
                    as ICatalogCollection);
end;

function  TCOMAdminCatalogCollection.GetUtilInterface: IDispatch;
begin
  Result := DefaultInterface.GetUtilInterface;
end;

procedure TCOMAdminCatalogCollection.PopulateByKey(aKeys: PSafeArray);
begin
  DefaultInterface.PopulateByKey(aKeys);
end;

procedure TCOMAdminCatalogCollection.PopulateByQuery(const bstrQueryString: WideString; 
                                                     lQueryType: Integer);
begin
  DefaultInterface.PopulateByQuery(bstrQueryString, lQueryType);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -