Hi I want to redo an app I made in visual basic in delphi so that I can add alot more features to it
heres the vb code
Private Sub Command1_Click()
Dim flags, targetframename, postdata, url, ref As String
flags = 1
targetframename = ""
postdata = ""
url = Text2.Text
ref = Text1.Text
headers = "Referer: " & ref & 10 & 13
WebBrowser1.Navigate url, flags, targetframename, postdata, headers
End Sub
heres what I have in delphi
procedure TForm1.Button1Click(Sender: TObject);
begin
flags := '1';
targetframename := '';
postdata := '';
url := labelededit1.Text;
ref := labelededit2.Text;
headers := 'Referer: ' + ref + '10' + '13';
webbrowser1.Navigate(url, flags, targetframename, postdata, headers);
end;
In delphi I get the following compile error though
[Error] Unit1.pas(39): There is no overloaded version of 'Navigate' that can be called with these arguments
Any help on this would be apreciated
Thanks
Comments
: can add alot more features to it
:
: heres the vb code
:
: Private Sub Command1_Click()
: Dim flags, targetframename, postdata, url, ref As String
: flags = 1
: targetframename = ""
: postdata = ""
: url = Text2.Text
: ref = Text1.Text
: headers = "Referer: " & ref & 10 & 13
: WebBrowser1.Navigate url, flags, targetframename, postdata,
: headers
:
: End Sub
:
: heres what I have in delphi
:
: procedure TForm1.Button1Click(Sender: TObject);
: begin
: flags := '1';
: targetframename := '';
: postdata := '';
: url := labelededit1.Text;
: ref := labelededit2.Text;
: headers := 'Referer: ' + ref + '10' + '13';
: webbrowser1.Navigate(url, flags, targetframename, postdata,
: headers);
: end;
:
: In delphi I get the following compile error though
:
: [Error] Unit1.pas(39): There is no overloaded version of 'Navigate'
: that can be called with these arguments
:
: Any help on this would be apreciated
: Thanks
:
What kind of types did you give the various variables? For the Navigate() call to work the types must match perfectly. See helpfiles for the exact types.
procedure TForm1.Button1Click(Sender: TObject);
var
Flags, Headers, TargetFrameName, PostData: OleVariant;
Url, Ref: string;
begin
flags := '1';
targetframename := '';
postdata := '';
url := labelededit2.Text;
ref := labelededit1.Text;
headers := 'Referer: ' + ref + #10 + #13;
webbrowser1.Navigate(url, flags, targetframename, postdata, headers);
end;
The error message is not that self-explanatory for a new user.
This (error message)means you are accessing a method "Navigate" for object "webbrowser1" which have different number parameters types or count that you are passing than the original declaration.
For emample,
There is a object MyObject which have Add method like below:
MyObject = Class
function Add(a: Integer; b: Integer) : Integer; Overload;
function Add(a: Integer; b: Integer; c: Integer) : Integer; Overload;
end;
Here in this example, you can call "Add" method with either two or three parameters. It will do the job of addition. (For that you have to write the code...
In your problem, there might be no such method "webbrowser1.Navigate" with the number of input parametes or data type of some of them might be different to the original declaration.
Still you have any doubt, please revert...
Abhijeet Patil.