getidaddimpl.pas

来自「DELPHI7编程百例 DELPHI7编程百例 DELPHI7编程百例」· PAS 代码 · 共 56 行

PAS
56
字号
{ Invokable implementation File for TGetIDadd which implements IGetIDadd }

unit GetIDaddImpl;

interface

uses SysUtils,InvokeRegistry, Types, XSBuiltIns, GetIDaddIntf, Unit1;

type

  { TGetIDadd }
  TGetIDadd = class(TInvokableClass, IGetIDadd)
  public
    function echoEnum(const Value: TEnumTest): TEnumTest; stdcall;
    function echoDoubleArray(const Value: TDoubleArray): TDoubleArray; stdcall;
    function echoMyEmployee(const Value: TMyEmployee): TMyEmployee; stdcall;
    function echoDouble(const Value: Integer): String; stdcall;
  end;

implementation

function TGetIDadd.echoEnum(const Value: TEnumTest): TEnumTest; stdcall;
begin
  { TODO : Implement method echoEnum }
  Result := Value;
end;

function TGetIDadd.echoDoubleArray(const Value: TDoubleArray): TDoubleArray; stdcall;
begin
  { TODO : Implement method echoDoubleArray }
  Result := Value;
end;

function TGetIDadd.echoMyEmployee(const Value: TMyEmployee): TMyEmployee; stdcall;
begin
  { TODO : Implement method echoMyEmployee }
  Result := TMyEmployee.Create;
end;

function TGetIDadd.echoDouble(const Value: Integer): String; stdcall;
begin
  { TODO : Implement method echoDouble }
  Form1.ADOQuery1.Close;
  Form1.ADOQuery1.SQL.Clear;
  Form1.ADOQuery1.SQL.Add('Select * from id where code="' + Inttostr(Value) +'"');
  Form1.ADOQuery1.Open;
  Result := Form1.ADOQuery1.FieldByName('name').AsString;
  Form1.ADOQuery1.Close;
end;

initialization
  { Invokable classes must be registered }
  InvRegistry.RegisterInvokableClass(TGetIDadd);

end.
 

⌨️ 快捷键说明

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