MdAggregate.pas
资源名称:delphi.rar [点击查看]
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:
Delphi控件源码
开发平台:
Delphi
- unit MdAggregate;
- interface
- type
- TMdAggregatedObject = class
- private
- FController: Pointer;
- function GetController: IInterface;
- protected
- { IInterface }
- function QueryInterface(const IID: TGUID; out Obj): HResult; stdcall;
- function _AddRef: Integer; stdcall;
- function _Release: Integer; stdcall;
- public
- constructor Create(Controller: IInterface);
- property Controller: IInterface read GetController;
- end;
- implementation
- function TMdAggregatedObject._AddRef: Integer;
- begin
- Result := IInterface(FController)._AddRef;
- end;
- function TMdAggregatedObject._Release: Integer;
- begin
- Result := IInterface(FController)._Release;
- end;
- constructor TMdAggregatedObject.Create(Controller: IInterface);
- begin
- FController := Pointer(Controller);
- end;
- function TMdAggregatedObject.GetController: IInterface;
- begin
- Result := IInterface(FController);
- end;
- function TMdAggregatedObject.QueryInterface(const IID: TGUID;
- out Obj): HResult;
- begin
- Result := IUnknown(FController).QueryInterface(IID, Obj);
- end;
- end.