473,382 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

IWebBrowser2: Navigate2 ignored

Hello.

I am trying to launch the internet explorer from my program using the code
seen below but unfortunately the Navigate2 command is ignored.
So Navigate2 is not working but calling GoHome() the start page is being
displayed...???

Has someone an idea what I am doing wrong?
Here´s the code:

HRESULT hr;
IWebBrowser2* pWebBrowser = NULL;
HRESULT comInit = CoInitializeEx(NULL,COINIT_MULTITHREADED);
hr = CoCreateInstance (CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER,
IID_IWebBrowser2, (LPVOID*)&pWebBrowser);
if (SUCCEEDED (hr) && (pWebBrowser != NULL))
{
m_pWebBrowser = pWebBrowser;
m_pWebBrowser->put_RegisterAsBrowser(VARIANT_TRUE);
m_pWebBrowser->put_AddressBar(VARIANT_FALSE);
m_pWebBrowser->put_MenuBar(VARIANT_FALSE);
m_pWebBrowser->put_StatusBar(VARIANT_FALSE);
m_pWebBrowser->put_ToolBar(VARIANT_FALSE);
m_pWebBrowser->put_Visible (VARIANT_TRUE);
m_pWebBrowser->put_Offline(VARIANT_FALSE);
}
else
{
if (pWebBrowser)
pWebBrowser->Release ();
}
CComVariant *url = new CComVariant("http://localhost/");
// VARIANT* url = new "http://www.microsoft.com";
m_pWebBrowser->Navigate2(url, NULL, NULL, NULL, NULL);

Thanks a lot for any help!
Greetings,
Tim.
Jul 22 '05 #1
3 9838
"Tim Bücker" <ti*************@web.de> wrote in message
news:cp**********@news.uni-koblenz.de...
Hello.

I am trying to launch the internet explorer from my program using the code
seen below but unfortunately the Navigate2 command is ignored.
So Navigate2 is not working but calling GoHome() the start page is being
displayed...???


[snip]

You have taken the wrong turn somewhere.
http://www.slack.net/~shiva/welcome.txt

DW
Jul 22 '05 #2
You probably would have better luck getting these types of questions
answered in one of the following groups:
comp.os.ms-windows.programmer.ole
comp.os.ms-windows.programmer.win32

At the same time, giving zero assistance is not my style...

While I haven't checked out your sample in detail, I can tell you that
Navigate2 responds better if you pass an empty variant rather than NULL
for parameters 2-5. In other words, assuming everything else is right,
you should try something like this:

CComVariant url("http://localhost/");
CComVariant empty;
m_pWebBrowser->Navigate2(&url, &empty, &empty, &empty, &empty);
Regards,

Michael Loritsch

Jul 22 '05 #3
<ri***@hotmail.com>
You probably would have better luck getting these types of questions
answered in one of the following groups:
comp.os.ms-windows.programmer.ole
comp.os.ms-windows.programmer.win32
Hello Michael Loritsch,

thanks for pointing out some newsgroups where to post my question legally
;-)
At the same time, giving zero assistance is not my style...
And a big thanks also to your attitude as your answer is totally correct!
While I haven't checked out your sample in detail, I can tell you that
Navigate2 responds better if you pass an empty variant rather than NULL
for parameters 2-5. In other words, assuming everything else is right,
you should try something like this:

CComVariant url("http://localhost/");
CComVariant empty;
m_pWebBrowser->Navigate2(&url, &empty, &empty, &empty, &empty);


I didn´t tried it out yet but later I posted the question to
"microsoft.public.inetsdk.programming.webbrowser_c tl"
and I got this answer:

CComVariant url(OLESTR("http://localhost/"));
CComVariant varEmpty;
m_pWebBrowser->Navigate2(&url,&varEmpty, &varEmpty, &varEmpty, &varEmpty);

So again a big thanks to you!
And sorry for posting my question here.

Greetings,
Tim.
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Koonaka | last post by:
Hi all, I am tryiing to post data from one web page to another using the webbrowser control's navigate2 or navigate method. The examples I can find tell me that i need to send the post data in...
29
by: | last post by:
I did a working code with CDONTS on NT4 Now I am testing is on w2k and it looks like objCDONTS.Send is completely ignored. I think is it ignored because it throws no errors, neither does the...
1
by: Kevin | last post by:
Hi, My application is a MDI and for each document, I create a WebBrowser control and call Navigate2 to get the HTML view of each document. I have tried opened two documents and Navigate2 to...
0
by: VZUmar | last post by:
Hi I am using IWebBrowser2 in my VC++ windows Application, My application uses browser control to navigate through different web pages. IE of machine has Security setting "Empty Temporary Internet...
0
by: Noël Thoelen | last post by:
Hy I am using the webbrowser control with the navigate2 method. I have a problem when i pass 2 times the same url to the navigate2 method. I will load old content, so i assume it has something...
0
by: nanz | last post by:
We have the following code in our application: Try ProgressWindow.lblProgressTxt.Text = "Establishing connection with ..." ProgressWindow.BringToFront() PIE.Navigate2(PGUIURL, "", "", "",...
0
by: Dean Hallman | last post by:
Hello, I am developing a BHO that should add a custom HTTP header on a specific domain only. Don't want the header globally, otherwise I could just add a registry key. So, on...
0
by: Fette | last post by:
I am using the AxSHDocVw.AxWebBrowser navigate2() method to launch the login web service for my application. IIS has been configured to require client side certificates. I am using a smart card...
5
by: zhang | last post by:
error C3861: 'Navigate2': identifier not found why???
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.