以下程序在2個地方(第39和45行)返回error : e2035 not enough actual parameters
,並且不進行編譯。有人可以幫我嗎? 我可以在這裏放置0或null來代替參數嗎?沒有足夠的實際參數?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,ComObj,shdocvw,activex, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
mybrowser : iwebbrowser2;
myUserName,
myPassword,loginURL : string;
Flags: OleVariant;
begin
Flags := navOpenInNewWindow;
MyBrowser := CreateOleObject('InternetExplorer.Application') as IWebBrowser2;
MyBrowser.Navigate('http://www.gmail.com',flags,'_blank');
myUserName := 'UserName';
myPassword := 'password';
loginURL:='javascript:var Email = document.getElementById(''Email'');Email.value=''' + myUserName + ''';var Password = document.getElementById(''Passwd'');Password.value=''' + myPassword + ''';var SignIn = document.getElementById(''signIn'');SignIn.click();';
MyBrowser.Navigate(loginURL);
end;
end.
爾,線39是 「MYPASSWORD:= '密碼';」 45是空行。您能否請您提出違規的評論? – 2010-05-23 12:32:48
@Frank Shearar:這是對Navigate的調用,它需要5個參數(不是3或1)。 – 2010-05-23 12:36:21