给出tlbpas 求调用

dejiang 2017-07-13 04:35:39
unit ulesignature_TLB;

// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //

// PASTLWTR : 1.2
// File generated on 2017-07-13 15:54:01 from Type Library described below.

// ************************************************************************ //
// Type Lib: D:\wyf\我的程序\邮乐\api\1\ulesignature.tlb (1)
// LIBID: {F0A6FD00-0540-3C7D-80F9-69689ADDF5F2}
// LCID: 0
// Helpfile:
// HelpString:
// DepndLst:
// (1) v2.0 stdole, (C:\Windows\system32\stdole2.tlb)
// (2) v2.4 mscorlib, (C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.tlb)
// Errors:
// Error creating palette bitmap of (THmacmd5) : Server mscoree.dll contains no icons
// ************************************************************************ //
// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, mscorlib_TLB, OleServer, StdVCL, Variants;



// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
ulesignatureMajorVersion = 1;
ulesignatureMinorVersion = 0;

LIBID_ulesignature: TGUID = '{F0A6FD00-0540-3C7D-80F9-69689ADDF5F2}';

IID__Hmacmd5: TGUID = '{9D6249F3-5F4C-34D9-8512-BB23811620C0}';
CLASS_Hmacmd5: TGUID = '{A83AAF21-F5A8-3F52-A034-2B94E13AF4AB}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
_Hmacmd5 = interface;
_Hmacmd5Disp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
Hmacmd5 = _Hmacmd5;


// *********************************************************************//
// Interface: _Hmacmd5
// Flags: (4432) Hidden Dual OleAutomation Dispatchable
// GUID: {9D6249F3-5F4C-34D9-8512-BB23811620C0}
// *********************************************************************//
_Hmacmd5 = interface(IDispatch)
['{9D6249F3-5F4C-34D9-8512-BB23811620C0}']
end;

// *********************************************************************//
// DispIntf: _Hmacmd5Disp
// Flags: (4432) Hidden Dual OleAutomation Dispatchable
// GUID: {9D6249F3-5F4C-34D9-8512-BB23811620C0}
// *********************************************************************//
_Hmacmd5Disp = dispinterface
['{9D6249F3-5F4C-34D9-8512-BB23811620C0}']
end;

// *********************************************************************//
// The Class CoHmacmd5 provides a Create and CreateRemote method to
// create instances of the default interface _Hmacmd5 exposed by
// the CoClass Hmacmd5. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoHmacmd5 = class
class function Create: _Hmacmd5;
class function CreateRemote(const MachineName: string): _Hmacmd5;
end;


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : THmacmd5
// Help String :
// Default Interface: _Hmacmd5
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
THmacmd5Properties= class;
{$ENDIF}
THmacmd5 = class(TOleServer)
private
FIntf: _Hmacmd5;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: THmacmd5Properties;
function GetServerProperties: THmacmd5Properties;
{$ENDIF}
function GetDefaultInterface: _Hmacmd5;
protected
procedure InitServerData; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: _Hmacmd5);
procedure Disconnect; override;
property DefaultInterface: _Hmacmd5 read GetDefaultInterface;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: THmacmd5Properties read GetServerProperties;
{$ENDIF}
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : THmacmd5
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
THmacmd5Properties = class(TPersistent)
private
FServer: THmacmd5;
function GetDefaultInterface: _Hmacmd5;
constructor Create(AServer: THmacmd5);
protected
public
property DefaultInterface: _Hmacmd5 read GetDefaultInterface;
published
end;
{$ENDIF}


procedure Register;

resourcestring
dtlServerPage = 'COM+';

dtlOcxPage = 'COM+';

implementation

uses ComObj;

class function CoHmacmd5.Create: _Hmacmd5;
begin
Result := CreateComObject(CLASS_Hmacmd5) as _Hmacmd5;
end;

class function CoHmacmd5.CreateRemote(const MachineName: string): _Hmacmd5;
begin
Result := CreateRemoteComObject(MachineName, CLASS_Hmacmd5) as _Hmacmd5;
end;

procedure THmacmd5.InitServerData;
const
CServerData: TServerData = (
ClassID: '{A83AAF21-F5A8-3F52-A034-2B94E13AF4AB}';
IntfIID: '{9D6249F3-5F4C-34D9-8512-BB23811620C0}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;

procedure THmacmd5.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as _Hmacmd5;
end;
end;

procedure THmacmd5.ConnectTo(svrIntf: _Hmacmd5);
begin
Disconnect;
FIntf := svrIntf;
end;

procedure THmacmd5.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;

function THmacmd5.GetDefaultInterface: _Hmacmd5;
begin
if FIntf = nil then
Connect;
Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
Result := FIntf;
end;

constructor THmacmd5.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := THmacmd5Properties.Create(Self);
{$ENDIF}
end;

destructor THmacmd5.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function THmacmd5.GetServerProperties: THmacmd5Properties;
begin
Result := FProps;
end;
{$ENDIF}

{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor THmacmd5Properties.Create(AServer: THmacmd5);
begin
inherited Create;
FServer := AServer;
end;

function THmacmd5Properties.GetDefaultInterface: _Hmacmd5;
begin
Result := FServer.DefaultInterface;
end;

{$ENDIF}

procedure Register;
begin
RegisterComponents(dtlServerPage, [THmacmd5]);
end;

end.


这个是由c# regasm 转换而来的,怎么在delphi中调用
...全文
330 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
doloopcn 2017-07-14
  • 打赏
  • 举报
回复
在调用的模块中加入: uses ulesignature_TLB; 应该就可以了 前提是操作系统 (1) v2.0 stdole, (C:\Windows\system32\stdole2.tlb) (2) v2.4 mscorlib, (C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.tlb) 需要有这两个文件
不得闲 2017-07-14
  • 打赏
  • 举报
回复
这个是Delphi自己生成的吧。就是一个控件 THmacmd5。就是的 最简单的办法是你自己创建一个包,把这个加入进去,注册到IDE,可以直接拖拉来处理。另外要注册那个OCX

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧