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

📄 shockwaveflashobjects_tlb.pas

📁 delphi中TShockwaveFlash的扩展
💻 PAS
📖 第 1 页 / 共 4 页
字号:
  end;
{$ENDIF}


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


// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object    : TFlashObjectInterface
// Help String      : IFlashObjectInterface Interface
// Default Interface: IFlashObjectInterface
// Def. Intf. DISP? : No
// Event   Interface: 
// TypeFlags        : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  TFlashObjectInterfaceProperties= class;
{$ENDIF}
  TFlashObjectInterface = class(TOleServer)
  private
    FIntf: IFlashObjectInterface;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    FProps: TFlashObjectInterfaceProperties;
    function GetServerProperties: TFlashObjectInterfaceProperties;
{$ENDIF}
    function GetDefaultInterface: IFlashObjectInterface;
  protected
    procedure InitServerData; override;
  public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;
    procedure Connect; override;
    procedure ConnectTo(svrIntf: IFlashObjectInterface);
    procedure Disconnect; override;
    function GetDispID(const bstrName: WideString; grfdex: LongWord; out pid: Integer): HResult;
    function RemoteInvokeEx(id: Integer; lcid: LongWord; dwFlags: LongWord; var pdp: DISPPARAMS; 
                            out pvarRes: OleVariant; out pei: EXCEPINFO; 
                            const pspCaller: IServiceProvider; cvarRefArg: SYSUINT; 
                            var rgiRefArg: SYSUINT; var rgvarRefArg: OleVariant): HResult;
    function DeleteMemberByName(const bstrName: WideString; grfdex: LongWord): HResult;
    function DeleteMemberByDispID(id: Integer): HResult;
    function GetMemberProperties(id: Integer; grfdexFetch: LongWord; out pgrfdex: LongWord): HResult;
    function GetMemberName(id: Integer; out pbstrName: WideString): HResult;
    function GetNextDispID(grfdex: LongWord; id: Integer; out pid: Integer): HResult;
    function GetNameSpaceParent(out ppunk: IUnknown): HResult;
    property DefaultInterface: IFlashObjectInterface read GetDefaultInterface;
  published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
    property Server: TFlashObjectInterfaceProperties read GetServerProperties;
{$ENDIF}
  end;

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


procedure Register;

resourcestring
  dtlServerPage = 'ActiveX';

  dtlOcxPage = 'ActiveX';

implementation

uses ComObj;

procedure TShockwaveFlash.InitControlData;
const
  CEventDispIDs: array [0..3] of DWORD = (
    $FFFFFD9F, $000007A6, $00000096, $000000C5);
  CControlData: TControlData2 = (
    ClassID: '{D27CDB6E-AE6D-11CF-96B8-444553540000}';
    EventIID: '{D27CDB6D-AE6D-11CF-96B8-444553540000}';
    EventCount: 4;
    EventDispIDs: @CEventDispIDs;
    LicenseKey: nil (*HR:$80004002*);
    Flags: $00000000;
    Version: 401);
begin
  ControlData := @CControlData;
  TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnReadyStateChange) - Cardinal(Self);
end;

procedure TShockwaveFlash.CreateControl;

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

begin
  if FIntf = nil then DoCreate;
end;

function TShockwaveFlash.GetControlInterface: IShockwaveFlash;
begin
  CreateControl;
  Result := FIntf;
end;

function TShockwaveFlash.Get_InlineData: IUnknown;
begin
    Result := DefaultInterface.InlineData;
end;

procedure TShockwaveFlash.Set_InlineData(const ppIUnknown: IUnknown);
begin
  DefaultInterface.Set_InlineData(ppIUnknown);
end;

procedure TShockwaveFlash.SetZoomRect(left: Integer; top: Integer; right: Integer; bottom: Integer);
begin
  DefaultInterface.SetZoomRect(left, top, right, bottom);
end;

procedure TShockwaveFlash.Zoom(factor: SYSINT);
begin
  DefaultInterface.Zoom(factor);
end;

procedure TShockwaveFlash.Pan(x: Integer; y: Integer; mode: SYSINT);
begin
  DefaultInterface.Pan(x, y, mode);
end;

procedure TShockwaveFlash.Play;
begin
  DefaultInterface.Play;
end;

procedure TShockwaveFlash.Stop;
begin
  DefaultInterface.Stop;
end;

procedure TShockwaveFlash.Back;
begin
  DefaultInterface.Back;
end;

procedure TShockwaveFlash.Forward;
begin
  DefaultInterface.Forward;
end;

procedure TShockwaveFlash.Rewind;
begin
  DefaultInterface.Rewind;
end;

procedure TShockwaveFlash.StopPlay;
begin
  DefaultInterface.StopPlay;
end;

procedure TShockwaveFlash.GotoFrame(FrameNum: Integer);
begin
  DefaultInterface.GotoFrame(FrameNum);
end;

function TShockwaveFlash.CurrentFrame: Integer;
begin
  Result := DefaultInterface.CurrentFrame;
end;

function TShockwaveFlash.IsPlaying: WordBool;
begin
  Result := DefaultInterface.IsPlaying;
end;

function TShockwaveFlash.PercentLoaded: Integer;
begin
  Result := DefaultInterface.PercentLoaded;
end;

function TShockwaveFlash.FrameLoaded(FrameNum: Integer): WordBool;
begin
  Result := DefaultInterface.FrameLoaded(FrameNum);
end;

function TShockwaveFlash.FlashVersion: Integer;
begin
  Result := DefaultInterface.FlashVersion;
end;

procedure TShockwaveFlash.LoadMovie(layer: SYSINT; const url: WideString);
begin
  DefaultInterface.LoadMovie(layer, url);
end;

procedure TShockwaveFlash.TGotoFrame(const target: WideString; FrameNum: Integer);
begin
  DefaultInterface.TGotoFrame(target, FrameNum);
end;

procedure TShockwaveFlash.TGotoLabel(const target: WideString; const label_: WideString);
begin
  DefaultInterface.TGotoLabel(target, label_);
end;

function TShockwaveFlash.TCurrentFrame(const target: WideString): Integer;
begin
  Result := DefaultInterface.TCurrentFrame(target);
end;

function TShockwaveFlash.TCurrentLabel(const target: WideString): WideString;
begin
  Result := DefaultInterface.TCurrentLabel(target);
end;

procedure TShockwaveFlash.TPlay(const target: WideString);
begin
  DefaultInterface.TPlay(target);
end;

procedure TShockwaveFlash.TStopPlay(const target: WideString);
begin
  DefaultInterface.TStopPlay(target);
end;

procedure TShockwaveFlash.SetVariable(const name: WideString; const value: WideString);
begin
  DefaultInterface.SetVariable(name, value);
end;

function TShockwaveFlash.GetVariable(const name: WideString): WideString;
begin
  Result := DefaultInterface.GetVariable(name);
end;

procedure TShockwaveFlash.TSetProperty(const target: WideString; property_: SYSINT; 
                                       const value: WideString);
begin
  DefaultInterface.TSetProperty(target, property_, value);
end;

function TShockwaveFlash.TGetProperty(const target: WideString; property_: SYSINT): WideString;
begin
  Result := DefaultInterface.TGetProperty(target, property_);
end;

procedure TShockwaveFlash.TCallFrame(const target: WideString; FrameNum: SYSINT);
begin
  DefaultInterface.TCallFrame(target, FrameNum);
end;

procedure TShockwaveFlash.TCallLabel(const target: WideString; const label_: WideString);
begin
  DefaultInterface.TCallLabel(target, label_);

⌨️ 快捷键说明

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