Самоучитель по Delphi 7 для профессионалов



              

Удаленный модуль данных для сервера Автоматизации - часть 3


Листинг 21.2. Вновь созданная библиотека типов для сервера приложения с исходным кодом интерфейса удаленного модуля данных 

LIBID_SimpleAppSrvr: TGUID='(93577575-OF4F-43B5-9FBE-A5745128D9A4}';

IID_ISimpleRDM: TGUID = '{Е2СВЕВСВ-1950-4054-В823-62906306Е840}'; CLASS_SimpleRDM: TGUID = '{DB6A6463-5F61-485F-8F23-EC6622091908}' ;

type

ISimpleRDM = interface; 

ISimpleRDMDisp = dispinterface;

SimpleRDM = ISimpleRDM;

ISimpleRDM = interface(lAppServer)

['{E2CBEBCB-1950-4054-B823-62906306E840}'] 

end;

ISimpleRDMDisp = dispinterface

['{E2CBEBCB-1950-4054-B823-62906306E840}']

function AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; MaxErrors: Integer; out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; dispid 20000000; function AS_GetRecords(const ProviderName: WideString; Count: Integer; out RecsOut: Integer; Options: Integer; const CommandText: WideString; var Params: OleVariant; var OwnerData: OleVariant): OleVariant; dispid 20000001;

function AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant; dispid 20000002;

function AS_GetProviderNames: OleVariant; dispid 20000003;

function AS_GetParams(const ProviderName: WideString;

var OwnerData: OleVariant): OleVariant; dispid 20000004;

function AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer; var OwnerData: OleVariant): OleVariant; dispid 20000005;

procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString; var Params: OleVariant; var OwnerData: OleVariant); 

dispid 20000006;

end;

CoSimpleRDM = class

class function Create: ISimpleRDM;

class function CreateRemote(const MachineName: string): ISimpleRDM;

 end;

imp1ementation uses ComObj;

class function CoSimpleRDM.Create: ISimpleRDM;

 begin

Result := CreateComObject(CLASS_SimpleRDM) as ISimpleRDM; 

end;

class function CoSimpleRDM.CreateRemote(const MachineName: string): ISimpleRDM;

begin

Result := CreateRemoteComObject(MachineName, CLASS_SimpleRDM)




Содержание  Назад  Вперед