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

📄 partsrv_tlb.pas

📁 《Delphi COM深入编程》原书光盘
💻 PAS
字号:
unit PartSrv_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.11.1.75  $
// File generated on 8/1/99 11:26:35 AM from Type Library described below.

// ************************************************************************ //
// Type Lib: J:\Book\samples\Chap07\PartServer2\PartSrv.tlb
// IID\LCID: {046CB030-4824-11D3-B83F-0040F67455FE}\0
// Helpfile: 
// HelpString: PartSrv Library
// Version:    1.0
// ************************************************************************ //

interface

uses Windows, ActiveX, Classes, Graphics, 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
  LIBID_PartSrv: TGUID = '{046CB030-4824-11D3-B83F-0040F67455FE}';
  IID_IPartServer: TGUID = '{046CB031-4824-11D3-B83F-0040F67455FE}';
  DIID_IPartServerEvents: TGUID = '{046CB033-4824-11D3-B83F-0040F67455FE}';
  CLASS_PartServer: TGUID = '{046CB035-4824-11D3-B83F-0040F67455FE}';

// *********************************************************************//
// Declaration of Enumerations defined in Type Library                  //
// *********************************************************************//
// FieldNumbers constants
type
  FieldNumbers = TOleEnum;
const
  fnPartNumber = $00000000;
  fnDescription = $00000001;
  fnUnitPrice = $00000002;
  fnOnHand = $00000003;
  fnReorder = $00000004;

type

// *********************************************************************//
// Forward declaration of interfaces defined in Type Library            //
// *********************************************************************//
  IPartServer = interface;
  IPartServerDisp = dispinterface;
  IPartServerEvents = dispinterface;

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


// *********************************************************************//
// Interface: IPartServer
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {046CB031-4824-11D3-B83F-0040F67455FE}
// *********************************************************************//
  IPartServer = interface(IDispatch)
    ['{046CB031-4824-11D3-B83F-0040F67455FE}']
    function GetAll(varFields: OleVariant): OleVariant; safecall;
    function GetPart(const PartNumber: WideString; varFields: OleVariant): OleVariant; safecall;
    procedure AddPart(varFields: OleVariant; varValues: OleVariant); safecall;
    procedure DeletePart(const PartNumber: WideString); safecall;
    procedure ModifyPart(const PartNumber: WideString; varFields: OleVariant; varValues: OleVariant); safecall;
    procedure UsePart(const PartNumber: WideString; Quantity: Integer); safecall;
  end;

// *********************************************************************//
// DispIntf:  IPartServerDisp
// Flags:     (4416) Dual OleAutomation Dispatchable
// GUID:      {046CB031-4824-11D3-B83F-0040F67455FE}
// *********************************************************************//
  IPartServerDisp = dispinterface
    ['{046CB031-4824-11D3-B83F-0040F67455FE}']
    function GetAll(varFields: OleVariant): OleVariant; dispid 1;
    function GetPart(const PartNumber: WideString; varFields: OleVariant): OleVariant; dispid 2;
    procedure AddPart(varFields: OleVariant; varValues: OleVariant); dispid 3;
    procedure DeletePart(const PartNumber: WideString); dispid 4;
    procedure ModifyPart(const PartNumber: WideString; varFields: OleVariant; varValues: OleVariant); dispid 5;
    procedure UsePart(const PartNumber: WideString; Quantity: Integer); dispid 6;
  end;

// *********************************************************************//
// DispIntf:  IPartServerEvents
// Flags:     (0)
// GUID:      {046CB033-4824-11D3-B83F-0040F67455FE}
// *********************************************************************//
  IPartServerEvents = dispinterface
    ['{046CB033-4824-11D3-B83F-0040F67455FE}']
    procedure OnAdd(varFields: OleVariant; varValues: OleVariant); dispid 1;
    procedure OnDelete(const PartNumber: WideString); dispid 2;
    procedure OnModify(const PartNumber: WideString; varFields: OleVariant; varValues: OleVariant); dispid 3;
  end;

  CoPartServer = class
    class function Create: IPartServer;
    class function CreateRemote(const MachineName: string): IPartServer;
  end;

implementation

uses ComObj;

class function CoPartServer.Create: IPartServer;
begin
  Result := CreateComObject(CLASS_PartServer) as IPartServer;
end;

class function CoPartServer.CreateRemote(const MachineName: string): IPartServer;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_PartServer) as IPartServer;
end;

end.

⌨️ 快捷键说明

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