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

📄 obj.pas

📁 一个很简洁的COM接口源码
💻 PAS
字号:
unit Obj;

interface

uses
  SysUtils, Classes, windows,
  uInterface;      //引用接口单元,将接口独立存放可以方便客户和服务程序之间互相引用

type

  TInfo = class(TInterfacedObject, IInfo)
    FInfo: PChar;
  protected
    procedure ShowInfo; stdcall;
    procedure SetInfo(P: PChar); stdcall;
    procedure FreeObj; stdcall;
  end;

implementation

{ TInfo }

procedure TInfo.FreeObj;
begin
  if finfo <> nil then StrDispose(FInfo);
  self.FRefCount := 0;
  self.Destroy;
end;

procedure TInfo.SetInfo(P: PChar);
begin                
  if FInfo <> nil then StrDispose(FInfo);
  FInfo := StrNew( p);
end;

procedure TInfo.ShowInfo;
begin
  messageboxa(0, FInfo, 'check', MB_OK)
end;

end.

⌨️ 快捷键说明

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