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

📄 soapfishimpl.pas

📁 Delphi7从入门到精通及附书源码 Delphi7从入门到精通及附书源码
💻 PAS
字号:
{ Invokable implementation File for TSoapFish which implements ISoapFish }

unit SoapFishImpl;

interface

uses InvokeRegistry, Types, XSBuiltIns, SoapFishIntf;

type
  { TSoapFish }
  TSoapFish = class(TInvokableClass, ISoapFish)
  public
    function GetCds: TSoapAttachment; stdcall;
    function GetImage(fishName: string): TSoapAttachment; stdcall;
  end;

implementation

uses
  SoapFishModule, Classes;

{ TSoapFish }

function TSoapFish.GetCds: TSoapAttachment; stdcall;
var
  memStr: TMemoryStream;
begin
  Result := TSoapAttachment.Create;
  memStr := TMemoryStream.Create;
  WebModule2.cdsFish.SaveToStream(MemStr); // binary
  Result.SetSourceStream (memStr, soReference);
end;

function TSoapFish.GetImage(fishName: string): TSoapAttachment; stdcall;
var
  memStr: TMemoryStream;
begin
  WebModule2.cdsFish.Locate('Common_Name', fishName, []);
  Result := TSoapAttachment.Create;
  memStr := TMemoryStream.Create;
  WebModule2.cdsFishGraphic.GraphicHeader := True;
  WebModule2.cdsFishGraphic.SaveToStream(memStr);
  Result.SetSourceStream (memStr, soReference);
end;

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

end.

⌨️ 快捷键说明

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