Board index » delphi » Problem with Web Browser ActiveX component

Problem with Web Browser ActiveX component

I'm using D2 and the IE WebBrowser imported as a component. No problems with
installation, but I don't have the right code to open a web site with the
component. I've seen some D4 code, as follows:

WebBrowser1.Navigate('http://www.anywhere.com', EmptyParam, EmptyParam,
EmptyParam, EmptyParam);

I think that the four parameters after the web address have to be there, but
they can be empty, and I know that EmptyParam is a D4-specific constant
which D2 doesn't recognise - the error message generated is 'Types of actual
and formal var parameters must be identical.'

What should I use in EmptyParam's place?

 

Re:Problem with Web Browser ActiveX component


Well, I've got Delphi 4, but I've never seen that code before. Try
this:

  var
    v1, v2, v3, v4: OleVariant;

  begin TForm1.Button1.Click(Sender:TObject);
    WebBrowser1.Navigate('http://www.altavista.com', v1, v2, v3, v4);
  end;

Its always worked for me. I'm not sure about the Sender: bit, just use
the WebBrowser1.Navigate line.

Dr.Dark

On Mon, 16 Aug 1999 21:25:02 GMT, "David Burgess"

Quote
<d.burg...@clara.net> wrote:
>I'm using D2 and the IE WebBrowser imported as a component. No problems with
>installation, but I don't have the right code to open a web site with the
>component. I've seen some D4 code, as follows:

>WebBrowser1.Navigate('http://www.anywhere.com', EmptyParam, EmptyParam,
>EmptyParam, EmptyParam);

>I think that the four parameters after the web address have to be there, but
>they can be empty, and I know that EmptyParam is a D4-specific constant
>which D2 doesn't recognise - the error message generated is 'Types of actual
>and formal var parameters must be identical.'

>What should I use in EmptyParam's place?

Other Threads