zoukankan      html  css  js  c++  java
  • 主控程序之插件装载器二

    获取插件中的预约接口,调用预约接口中的方法执行插件中某一项功能。

    unit Loader;

    interface

    uses
      DLLLoader, uInterface, SysUtils, Classes, windows;

    type
      TLoader = class(TDLLLoader)
      private
        FInts: IModelInts;
        function GetInts: IModelInts;
      public
        destructor destroy; override;
        property ModelServiceInts: IModelInts read GetInts;
      end;

    implementation

    { TLoader }

    destructor TLoader.destroy;
    begin
      if FInts <> nil then
        FInts := nil;
      inherited;
    end;

    function TLoader.GetInts: IModelInts;
    var
      InvokeFunc: function: IModelInts;
    begin
      if FInts = nil then
      begin
        @InvokeFunc := GetProcAddress(DLLHandle, pchar('GetModelInts'));
        if @InvokeFunc <> nil then
        begin
          FInts := InvokeFunc
        end else
          raise Exception.Create('插件未提供此方法');
      end;
      Result := FInts;
    end;

    end.

  • 相关阅读:
    带勾选框的组织F4
    VBA 学习
    MACD指标量化策略实战案例
    DOM
    JS基础下
    JS基础
    CSS基础
    html实战4--transform3D
    html实战3--精灵图
    html实战2--四叶草
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2358363.html
Copyright © 2011-2022 走看看