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

📄 uopcstringenumerator.pas

📁 delphi 开发OPc工业通讯 delphi 开发OPc工业通讯
💻 PAS
字号:
//******************************************************************************
// sOPC created by ACHAT SOLUTIONS GmbH, http://www.achat-solutions.de/
//******************************************************************************
unit uOPCStringEnumerator;

interface

uses
  Classes, WinProcs, ComObj, ActiveX;

type
  sOPCStringEnumerator = class(TComObject, IEnumString)
  private
    nextIndex: integer;
    FList: TStringList;
    FFree: boolean;
  public
    constructor Create(const aList: TStringList; aFree: boolean = True);
    destructor Destroy; override;
    function Next(celt: Longint; out elt; pceltFetched: PLongint): HResult; stdcall;
    function Skip(celt: Longint): HResult; stdcall;
    function Reset: HResult; stdcall;
    function Clone(out enm: IEnumString): HResult; stdcall;
  end;

implementation

uses
  ComServ, OPCDA, uGlobals;

constructor sOPCStringEnumerator.Create(const aList: TStringList; aFree: boolean);
begin
  inherited Create;
  FList := aList;
  FFree := aFree;
  nextIndex := 0;
end;

destructor sOPCStringEnumerator.Destroy;
begin
  if FFree then FList.Free;
  inherited Destroy;
end;

function sOPCStringEnumerator.Next(celt: Longint; out elt; pceltFetched: PLongint): HResult;
var
 i: integer;
begin
  // celt mu

⌨️ 快捷键说明

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