Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TWebBrowser->Navigate(...)

Status
Not open for further replies.

GirishGupta

Programmer
May 28, 2001
30
GB
Hi,

I'm new to 'C'.

I've got a TWebBrowser component. I have the following code:

Code:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
 Variant a = 0, b = 0, c = 0, d = 0;
 WebBrowser1->Navigate("[URL unfurl="true"]http://www.microsoft.com/",[/URL] a, b, c, d);
}

For some reason, it doesn't work. I get the following errors:

Code:
[C++ Error] Unit1.cpp(22): E2034 Cannot convert 'AnsiString' to 'wchar_t *'.
[C++ Error] Unit1.cpp(22): E2343 Type mismatch in parameter 'URL' in call to '_fastcall TWebBrowser::Navigate(wchar_t *,TVariant *,TVariant *,TVariant *,TVariant *)'.

Plese help...

Thanks in advance

Also, how do you convert, for example, a string to an int. Like in Delphi, this would be done by StrToInt()...how do you do it in C++?
 
Try it:

WebBrowser1->Navigate(L" a, b, c, d);
John Fill
1c.bmp


ivfmd@mail.md
 
This seems to work but it shows a 'CPU' window for some reason, however when I close this (a few times) it seems to work.

But, now this...

Code:
void __fastcall TForm1::SpeedButton2Click(TObject *Sender)
{
 WebBrowser1->GoForward;
}

...gives me the following error:

"Member function must be called or its address taken"

Any ideas?

 
try this.

Edit1->Text being the website to go to

WideString Url = String(Edit1->Text);
Form1->CppWebBrowser1->Navigate(BSTR(Url));

this way you dont have to deal with all of those variants.

Cyprus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top