areaintf.pas

来自「Delphi 下COM开发的重要参考书籍之一。使用有一定COM开发经验的使用者」· PAS 代码 · 共 42 行

PAS
42
字号
unit AreaIntf;

interface

uses
  Windows, ActiveX, Classes, ComObj, DCPTypeServer_TLB, StdVcl;

type
  TUnitAuto = class(TTypedComObject, IUnitAuto)
  protected
    function Convert(Quantity: Double; InUnit, OutUnit: SYSINT): Double;
      stdcall;
    function Get_Name: WideString; stdcall;
    procedure Set_Name(const Value: WideString); stdcall;
    {Declare IUnitAuto methods here}
  end;

implementation

uses ComServ;

function TUnitAuto.Convert(Quantity: Double; InUnit,
  OutUnit: SYSINT): Double;
begin
  { Stubbed out because we're only interested in the type library }
end;

function TUnitAuto.Get_Name: WideString;
begin
  { Stubbed out because we're only interested in the type library }
end;

procedure TUnitAuto.Set_Name(const Value: WideString);
begin
  { Stubbed out because we're only interested in the type library }
end;

initialization
  TTypedComObjectFactory.Create(ComServer, TUnitAuto, Class_UnitAuto,
    ciMultiInstance, tmApartment);
end.

⌨️ 快捷键说明

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