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

📄 moims_tlb.pas

📁 所有delphi的入门例子
💻 PAS
字号:
unit MoIMS_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 2009-1-22 上午 09:58:40 from Type Library described below.

// ************************************************************************  //
// Type Lib: C:\WINDOWS\system32\WebLink.ocx (1)
// LIBID: {B3BC60F0-E967-11CF-8543-00805F0C9E07}
// LCID: 0
// Helpfile: C:\WINDOWS\system32\WebLink.hlp
// HelpString: ESRI WebLink
// DepndLst: 
//   (1) v1.0 stdole, (C:\WINDOWS\system32\stdole32.tlb)
//   (2) v2.0 StdType, (C:\WINDOWS\system32\olepro32.dll)
// Errors:
//   Hint: Parameter 'string' of Strings.Add changed to 'string_'
// ************************************************************************ //
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers. 
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, OleCtrls, 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
  MoIMSMajorVersion = 1;
  MoIMSMinorVersion = 0;

  LIBID_MoIMS: TGUID = '{B3BC60F0-E967-11CF-8543-00805F0C9E07}';

  DIID__DWebLink: TGUID = '{B3BC60F1-E967-11CF-8543-00805F0C9E07}';
  DIID__DWebLinkEvents: TGUID = '{B3BC60F2-E967-11CF-8543-00805F0C9E07}';
  CLASS_WebLink: TGUID = '{B3BC60F3-E967-11CF-8543-00805F0C9E07}';
  DIID_Strings: TGUID = '{A151E110-EC83-11CF-98A2-00805F7CED21}';
  CLASS__Strings: TGUID = '{A151E111-EC83-11CF-98A2-00805F7CED21}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary                    
// *********************************************************************//
  _DWebLink = dispinterface;
  _DWebLinkEvents = dispinterface;
  Strings = dispinterface;

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


// *********************************************************************//
// DispIntf:  _DWebLink
// Flags:     (4112) Hidden Dispatchable
// GUID:      {B3BC60F1-E967-11CF-8543-00805F0C9E07}
// *********************************************************************//
  _DWebLink = dispinterface
    ['{B3BC60F1-E967-11CF-8543-00805F0C9E07}']
    procedure Stop; dispid 3;
    function WriteString(const text: WideString): WordBool; dispid 6;
    function WriteFile(const filename: WideString): WordBool; dispid 5;
    function Start: WordBool; dispid 4;
    procedure EnableGIF(const licenseCode: WideString); dispid 10;
    function BMP2GIF(const filename: WideString; interleaved: WordBool): WordBool; dispid 7;
    function WriteResponseHeader(const header: WideString): WordBool; dispid 8;
    procedure AboutBox; dispid -552;
    function BMP2JPEG(const filename: WideString; quality: OleVariant; progressive: OleVariant): WordBool; dispid 9;
    property MapPort: Integer dispid 2;
    property LocalIp: WideString dispid 1;
  end;

// *********************************************************************//
// DispIntf:  _DWebLinkEvents
// Flags:     (4096) Dispatchable
// GUID:      {B3BC60F2-E967-11CF-8543-00805F0C9E07}
// *********************************************************************//
  _DWebLinkEvents = dispinterface
    ['{B3BC60F2-E967-11CF-8543-00805F0C9E07}']
    procedure Request(const arguments: IDispatch; const values: IDispatch); dispid 1;
  end;

// *********************************************************************//
// DispIntf:  Strings
// Flags:     (4096) Dispatchable
// GUID:      {A151E110-EC83-11CF-98A2-00805F7CED21}
// *********************************************************************//
  Strings = dispinterface
    ['{A151E110-EC83-11CF-98A2-00805F7CED21}']
    function Find(const itemName: WideString; startIndex: OleVariant): Integer; dispid 6;
    function Item(Item: OleVariant): WideString; dispid 3;
    function _Item(Item: OleVariant): WideString; dispid 0;
    procedure Clear; dispid 5;
    function Add(const string_: WideString): WordBool; dispid 4;
    property Unique: WordBool dispid 2;
    property Count: Smallint dispid 1;
    property _NewEnum: IUnknown dispid -4;
  end;


// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name     : TWebLink
// Help String      : WebLink Control
// Default Interface: _DWebLink
// Def. Intf. DISP? : Yes
// Event   Interface: _DWebLinkEvents
// TypeFlags        : (38) CanCreate Licensed Control
// *********************************************************************//
  TWebLinkRequest = procedure(ASender: TObject; const arguments: IDispatch; const values: IDispatch) of object;

  TWebLink = class(TOleControl)
  private
    FOnRequest: TWebLinkRequest;
    FIntf: _DWebLink;
    function  GetControlInterface: _DWebLink;
  protected
    procedure CreateControl;
    procedure InitControlData; override;
  public
    procedure Stop;
    function WriteString(const text: WideString): WordBool;
    function WriteFile(const filename: WideString): WordBool;
    function Start: WordBool;
    procedure EnableGIF(const licenseCode: WideString);
    function BMP2GIF(const filename: WideString; interleaved: WordBool): WordBool;
    function WriteResponseHeader(const header: WideString): WordBool;
    procedure AboutBox;
    function BMP2JPEG(const filename: WideString; quality: OleVariant; progressive: OleVariant): WordBool;
    property  ControlInterface: _DWebLink read GetControlInterface;
    property  DefaultInterface: _DWebLink read GetControlInterface;
  published
    property Anchors;
    property MapPort: Integer index 2 read GetIntegerProp write SetIntegerProp stored False;
    property LocalIp: WideString index 1 read GetWideStringProp write SetWideStringProp stored False;
    property OnRequest: TWebLinkRequest read FOnRequest write FOnRequest;
  end;

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

procedure Register;

resourcestring
  dtlServerPage = 'ActiveX';

  dtlOcxPage = 'ActiveX';

implementation

uses ComObj;

procedure TWebLink.InitControlData;
const
  CEventDispIDs: array [0..0] of DWORD = (
    $00000001);
  CLicenseKey: array[0..23] of Word = ( $0043, $006F, $0070, $0079, $0072, $0069, $0067, $0068, $0074, $0020, $0028
    , $0063, $0029, $0020, $0031, $0039, $0039, $0036, $0020, $0045, $0053
    , $0052, $0049, $0000);
  CControlData: TControlData2 = (
    ClassID: '{B3BC60F3-E967-11CF-8543-00805F0C9E07}';
    EventIID: '{B3BC60F2-E967-11CF-8543-00805F0C9E07}';
    EventCount: 1;
    EventDispIDs: @CEventDispIDs;
    LicenseKey: @CLicenseKey;
    Flags: $00000000;
    Version: 401);
begin
  ControlData := @CControlData;
  TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnRequest) - Cardinal(Self);
end;

procedure TWebLink.CreateControl;

  procedure DoCreate;
  begin
    FIntf := IUnknown(OleObject) as _DWebLink;
  end;

begin
  if FIntf = nil then DoCreate;
end;

function TWebLink.GetControlInterface: _DWebLink;
begin
  CreateControl;
  Result := FIntf;
end;

procedure TWebLink.Stop;
begin
  DefaultInterface.Stop;
end;

function TWebLink.WriteString(const text: WideString): WordBool;
begin
  Result := DefaultInterface.WriteString(text);
end;

function TWebLink.WriteFile(const filename: WideString): WordBool;
begin
  Result := DefaultInterface.WriteFile(filename);
end;

function TWebLink.Start: WordBool;
begin
  Result := DefaultInterface.Start;
end;

procedure TWebLink.EnableGIF(const licenseCode: WideString);
begin
  DefaultInterface.EnableGIF(licenseCode);
end;

function TWebLink.BMP2GIF(const filename: WideString; interleaved: WordBool): WordBool;
begin
  Result := DefaultInterface.BMP2GIF(filename, interleaved);
end;

function TWebLink.WriteResponseHeader(const header: WideString): WordBool;
begin
  Result := DefaultInterface.WriteResponseHeader(header);
end;

procedure TWebLink.AboutBox;
begin
  DefaultInterface.AboutBox;
end;

function TWebLink.BMP2JPEG(const filename: WideString; quality: OleVariant; progressive: OleVariant): WordBool;
begin
  Result := DefaultInterface.BMP2JPEG(filename, quality, progressive);
end;

class function Co_Strings.Create: Strings;
begin
  Result := CreateComObject(CLASS__Strings) as Strings;
end;

class function Co_Strings.CreateRemote(const MachineName: string): Strings;
begin
  Result := CreateRemoteComObject(MachineName, CLASS__Strings) as Strings;
end;

procedure Register;
begin
  RegisterComponents(dtlOcxPage, [TWebLink]);
end;

end.

⌨️ 快捷键说明

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