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

📄 shockwaveflashobjects_tlb.pas

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

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

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

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

procedure TShockwaveFlash.EnforceLocalSecurity;
begin
  DefaultInterface.EnforceLocalSecurity;
end;

function TShockwaveFlash.CallFunction(const request: WideString): WideString;
begin
  Result := DefaultInterface.CallFunction(request);
end;

procedure TShockwaveFlash.SetReturnValue(const returnValue: WideString);
begin
  DefaultInterface.SetReturnValue(returnValue);
end;

procedure TShockwaveFlash.DisableLocalSecurity;
begin
  DefaultInterface.DisableLocalSecurity;
end;

class function CoFlashProp.Create: IUnknown;
begin
  Result := CreateComObject(CLASS_FlashProp) as IUnknown;
end;

class function CoFlashProp.CreateRemote(const MachineName: string): IUnknown;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_FlashProp) as IUnknown;
end;

procedure TFlashProp.InitServerData;
const
  CServerData: TServerData = (
    ClassID:   '{1171A62F-05D2-11D1-83FC-00A0C9089C5A}';
    IntfIID:   '{00000000-0000-0000-C000-000000000046}';
    EventIID:  '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

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

procedure TFlashProp.ConnectTo(svrIntf: IUnknown);
begin
  Disconnect;
  FIntf := svrIntf;
end;

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

function TFlashProp.GetDefaultInterface: IUnknown;
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 TFlashProp.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TFlashPropProperties.Create(Self);
{$ENDIF}
end;

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

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

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

function TFlashPropProperties.GetDefaultInterface: IUnknown;
begin
  Result := FServer.DefaultInterface;
end;

{$ENDIF}

class function CoFlashObjectInterface.Create: IFlashObjectInterface;
begin
  Result := CreateComObject(CLASS_FlashObjectInterface) as IFlashObjectInterface;
end;

class function CoFlashObjectInterface.CreateRemote(const MachineName: string): IFlashObjectInterface;
begin
  Result := CreateRemoteComObject(MachineName, CLASS_FlashObjectInterface) as IFlashObjectInterface;
end;

procedure TFlashObjectInterface.InitServerData;
const
  CServerData: TServerData = (
    ClassID:   '{D27CDB71-AE6D-11CF-96B8-444553540000}';
    IntfIID:   '{D27CDB72-AE6D-11CF-96B8-444553540000}';
    EventIID:  '';
    LicenseKey: nil;
    Version: 500);
begin
  ServerData := @CServerData;
end;

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

procedure TFlashObjectInterface.ConnectTo(svrIntf: IFlashObjectInterface);
begin
  Disconnect;
  FIntf := svrIntf;
end;

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

function TFlashObjectInterface.GetDefaultInterface: IFlashObjectInterface;
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 TFlashObjectInterface.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
  FProps := TFlashObjectInterfaceProperties.Create(Self);
{$ENDIF}
end;

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

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

function TFlashObjectInterface.GetDispID(const bstrName: WideString; grfdex: LongWord; 
                                         out pid: Integer): HResult;
begin
  Result := DefaultInterface.GetDispID(bstrName, grfdex, pid);
end;

function TFlashObjectInterface.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;
begin
  Result := DefaultInterface.RemoteInvokeEx(id, lcid, dwFlags, pdp, pvarRes, pei, pspCaller, 
                                            cvarRefArg, rgiRefArg, rgvarRefArg);
end;

function TFlashObjectInterface.DeleteMemberByName(const bstrName: WideString; grfdex: LongWord): HResult;
begin
  Result := DefaultInterface.DeleteMemberByName(bstrName, grfdex);
end;

function TFlashObjectInterface.DeleteMemberByDispID(id: Integer): HResult;
begin
  Result := DefaultInterface.DeleteMemberByDispID(id);
end;

function TFlashObjectInterface.GetMemberProperties(id: Integer; grfdexFetch: LongWord; 
                                                   out pgrfdex: LongWord): HResult;
begin
  Result := DefaultInterface.GetMemberProperties(id, grfdexFetch, pgrfdex);
end;

function TFlashObjectInterface.GetMemberName(id: Integer; out pbstrName: WideString): HResult;
begin
  Result := DefaultInterface.GetMemberName(id, pbstrName);
end;

function TFlashObjectInterface.GetNextDispID(grfdex: LongWord; id: Integer; out pid: Integer): HResult;
begin
  Result := DefaultInterface.GetNextDispID(grfdex, id, pid);
end;

function TFlashObjectInterface.GetNameSpaceParent(out ppunk: IUnknown): HResult;
begin
  Result := DefaultInterface.GetNameSpaceParent(ppunk);
end;

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

function TFlashObjectInterfaceProperties.GetDefaultInterface: IFlashObjectInterface;
begin
  Result := FServer.DefaultInterface;
end;

{$ENDIF}

procedure Register;
begin
  RegisterComponents(dtlOcxPage, [TShockwaveFlash]);
  RegisterComponents(dtlServerPage, [TFlashProp, TFlashObjectInterface]);
end;

end.

⌨️ 快捷键说明

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