Einzelnen Beitrag anzeigen

drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#1

Activex delphi netscape framework plugin

  Alt 13. Mär 2015, 09:27
hi , i been working with activex with internet explorer and i have no problem with it , my activex can read html params and set it like this

Code:
<object classid="clsid:projectid" codebase="File" width="900" height="500">
  <param name="name" value="test" />
  <param name="password" value="123456" />
</object>
i have create type library property called name and also other property called password and make them read and write to be able to read and set there params from html ,, every thing working fine , BUT when i decided to make also a netscape plugin with Netscape framework plugin by Mike Scott , the project works on netscape brwoser but iam unable to read html params always shows empty here is my dll netscape plugin code

Delphi-Quellcode:
unit maibf;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ActiveX, AxCtrls, typemain_TLB, StdVcl, Vcl.ExtCtrls, Vcl.StdCtrls,
  AdvGlowButton, Vcl.ImgList, VrControls, VrLevelBar, JvExExtCtrls, NPForm;

type
  Ttestproject = class(TPluginForm, Itestproject)
    btnCreateMessage: TAdvGlowButton;
    procedure FormShow(Sender: TObject);
    procedure btnCreateMessageClick(Sender: TObject);
  private
  protected
    function Get_uname: WideString; safecall;
    procedure Set_uname(const Value: WideString); safecall;
    function Get_password: WideString; safecall;
    procedure Set_password(const Value: WideString); safecall;
    { Private declarations }


  public
    { Public declarations }

  end;

  var
  testproject: Ttestproject;
  Gname : string;
  password : string;


implementation

uses ComObj, ComServ;

{$R *.DFM}

{ Ttestproject }


function Ttestproject.Get_uname: WideString;
begin
   Result := Gname;
end;

procedure Ttestproject.Set_uname(const Value: WideString);
begin
  Gname := Value;
end;

procedure Ttestproject.btnCreateMessageClick(Sender: TObject);
begin
showmessage(Gname);
end;

procedure Ttestproject.FormShow(Sender: TObject);
begin

end;

function Ttestproject.Get_password: WideString;
begin
 Result := password;
end;

procedure Ttestproject.Set_password(const Value: WideString);
begin
 password := Value
end;

initialization
  { Register the form with the plugin framework so that it gets created automatically. }
  { Registering with an empty string means it'll always be created whenever Netscape   }
  { creates an instance of a plugin from the plugin DLL. This is the simplest option   }
  { and should be used when there is only one TPlugin type in the plugin DLL. However, }
  { you can easily support more than one TPlugin type in a given DLL by registering    }
  { several with the appropriate MIME strings. Also, each TPlugin can be created for   }
  { multiple different MIME strings. Simply separate each individual MIME string       }
  { with a pipe character '|' or a semi-colon, e.g.                                    }
  {   'Application/x-test-pluginA|Application/x-test-pluginB'                          }
  { In this demo, there is only one plugin and plugin form so an empty string is       }
  { passed - when Netscape loads this plugin DLL, this is the TPluginForm that will be }
  { created.                                                                           }

  RegisterPluginForm( '', Ttestproject) ;
end.
when i try to showmessage the param name always empty and also param password, i think proprty in netscape plugin are not set or other errors any one can help me ?

Geändert von drama22 (13. Mär 2015 um 12:09 Uhr)
  Mit Zitat antworten Zitat