ucountobj.pas
来自「多数代码可以直接在Delphi6和Delphi7环境下运行。部分涉及.NET技术」· PAS 代码 · 共 33 行
PAS
33 行
unit uCountObj;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
Windows, ActiveX, Classes, ComObj, PCountDemo_TLB, StdVcl;
type
TCountObjDemo = class(TTypedComObject, ICountObjDemo)
private
igCounter : Integer;
protected
function CountMe(var iCount: Integer): HResult; stdcall;
{Declare ICountObjDemo methods here}
end;
implementation
uses ComServ;
function TCountObjDemo.CountMe(var iCount: Integer): HResult;
begin
iCount := InterlockedIncrement(igCounter);
Result := S_OK;
end;
initialization
TTypedComObjectFactory.Create(ComServer, TCountObjDemo, Class_CountObjDemo,
ciMultiInstance, tmBoth);
end.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?