📄 copyhook_tlb.pas
字号:
unit CopyHook_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 : $Revision: 1.88 $
// File generated on 2002-4-21 14:58:58 from Type Library described below.
// *************************************************************************//
// 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.
// ************************************************************************ //
// Type Lib: E:\Delphi高级编程源代码\CopyHook\CopyHook.tlb (1)
// IID\LCID: {0AE032C5-6EE6-4233-99F2-C2DDAF01F99A}\0
// Helpfile:
// DepndLst:
// (1) v2.0 stdole, (D:\WINDOWS\SYSTEM\stdole2.tlb)
// (2) v4.0 StdVCL, (D:\WINDOWS\SYSTEM\STDVCL40.DLL)
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
interface
uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;
// *********************************************************************//
// 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
CopyHookMajorVersion = 1;
CopyHookMinorVersion = 0;
LIBID_CopyHook: TGUID = '{0AE032C5-6EE6-4233-99F2-C2DDAF01F99A}';
IID_ICopyMain: TGUID = '{E1A29C06-0B2F-471D-BC3D-619B3745D34A}';
CLASS_CopyMain: TGUID = '{F5F139D8-F2C2-4BFC-B98C-DA061488DC34}';
type
// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
ICopyMain = interface;
// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
CopyMain = ICopyMain;
// *********************************************************************//
// Interface: ICopyMain
// Flags: (256) OleAutomation
// GUID: {E1A29C06-0B2F-471D-BC3D-619B3745D34A}
// *********************************************************************//
ICopyMain = interface(IUnknown)
['{E1A29C06-0B2F-471D-BC3D-619B3745D34A}']
end;
// *********************************************************************//
// The Class CoCopyMain provides a Create and CreateRemote method to
// create instances of the default interface ICopyMain exposed by
// the CoClass CopyMain. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoCopyMain = class
class function Create: ICopyMain;
class function CreateRemote(const MachineName: string): ICopyMain;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TCopyMain
// Help String : CopyMain Object
// Default Interface: ICopyMain
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TCopyMainProperties= class;
{$ENDIF}
TCopyMain = class(TOleServer)
private
FIntf: ICopyMain;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TCopyMainProperties;
function GetServerProperties: TCopyMainProperties;
{$ENDIF}
function GetDefaultInterface: ICopyMain;
protected
procedure InitServerData; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: ICopyMain);
procedure Disconnect; override;
property DefaultInterface: ICopyMain read GetDefaultInterface;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TCopyMainProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TCopyMain
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TCopyMainProperties = class(TPersistent)
private
FServer: TCopyMain;
function GetDefaultInterface: ICopyMain;
constructor Create(AServer: TCopyMain);
protected
public
property DefaultInterface: ICopyMain read GetDefaultInterface;
published
end;
{$ENDIF}
procedure Register;
implementation
uses ComObj;
class function CoCopyMain.Create: ICopyMain;
begin
Result := CreateComObject(CLASS_CopyMain) as ICopyMain;
end;
class function CoCopyMain.CreateRemote(const MachineName: string): ICopyMain;
begin
Result := CreateRemoteComObject(MachineName, CLASS_CopyMain) as ICopyMain;
end;
procedure TCopyMain.InitServerData;
const
CServerData: TServerData = (
ClassID: '{F5F139D8-F2C2-4BFC-B98C-DA061488DC34}';
IntfIID: '{E1A29C06-0B2F-471D-BC3D-619B3745D34A}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TCopyMain.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as ICopyMain;
end;
end;
procedure TCopyMain.ConnectTo(svrIntf: ICopyMain);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TCopyMain.DisConnect;
begin
if Fintf <> nil then
begin
FIntf := nil;
end;
end;
function TCopyMain.GetDefaultInterface: ICopyMain;
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 TCopyMain.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps := TCopyMainProperties.Create(Self);
{$ENDIF}
end;
destructor TCopyMain.Destroy;
begin
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps.Free;
{$ENDIF}
inherited Destroy;
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
function TCopyMain.GetServerProperties: TCopyMainProperties;
begin
Result := FProps;
end;
{$ENDIF}
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
constructor TCopyMainProperties.Create(AServer: TCopyMain);
begin
inherited Create;
FServer := AServer;
end;
function TCopyMainProperties.GetDefaultInterface: ICopyMain;
begin
Result := FServer.DefaultInterface;
end;
{$ENDIF}
procedure Register;
begin
RegisterComponents('Servers',[TCopyMain]);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -