473,782 Members | 2,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_MUL TITHREADED);
hr = CoCreateInstanc e (CLSID_Internet Explorer, NULL, CLSCTX_LOCAL_SE RVER,
IID_IWebBrowser 2, (LPVOID*)&pWebB rowser);
if (SUCCEEDED (hr) && (pWebBrowser != NULL))
{
m_pWebBrowser = pWebBrowser;
m_pWebBrowser->put_RegisterAs Browser(VARIANT _TRUE);
m_pWebBrowser->put_AddressBar (VARIANT_FALSE) ;
m_pWebBrowser->put_MenuBar(VA RIANT_FALSE);
m_pWebBrowser->put_StatusBar( VARIANT_FALSE);
m_pWebBrowser->put_ToolBar(VA RIANT_FALSE);
m_pWebBrowser->put_Visible (VARIANT_TRUE);
m_pWebBrowser->put_Offline(VA RIANT_FALSE);
}
else
{
if (pWebBrowser)
pWebBrowser->Release ();
}
CComVariant *url = new CComVariant("ht tp://localhost/");
// VARIANT* url = new "http://www.microsoft.c om";
m_pWebBrowser->Navigate2(ur l, NULL, NULL, NULL, NULL);

Thanks a lot for any help!
Greetings,
Tim.
Jul 22 '05 #1
3 9870
"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.program mer.ole
comp.os.ms-windows.program mer.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.program mer.ole
comp.os.ms-windows.program mer.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.publ ic.inetsdk.prog ramming.webbrow ser_ctl"
and I got this answer:

CComVariant url(OLESTR("htt p://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
4941
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 ascii binary format which can be done in a safearray. Does anyone know how to do this in VB6 or is there another way? Thanks
29
3546
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 rest of the code setting objCDONTS=Server.CreateObject("CDONTS.NewMail") and then manipulating its properties. Do I need to somehow set IIS5 to make objCDONTS.Send work?
1
3578
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 the same ASP page. I find that I get the same sessionId of these two view and the data of these two documents are screwed up. Do you know why the two WebBrowser controls have the same session id? (is
0
1834
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 Files folder when browser is closed" selected or enabled. Since my application used WebBrowser Control temporary internet files are not deleted. How can I force IWebBrowser2 Control to do cleanup of IE Temporary files whe my application exits ...
0
2347
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 todo with caching I have tried to pass the NoReadFromCache flag, but it does not solve my problem: webbrowser1.navigate2 sUrl, 4
0
1179
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
3736
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 BEFORENAVIGATE2, I am canceling the current navigation and renavigating with the new custom header using Navigate2. This usually works fine, but in some cases (particularly when selecting a link that starts a new window), the Navigate2 call fails.
0
1983
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 and choose the appropriate certificate from those that are found on the card. My question is this: Is navigate2() a blocking method? That is, when I make the call to navigate2 with my login service URL and Internet Explorer pops up the PIN...
5
2081
by: zhang | last post by:
error C3861: 'Navigate2': identifier not found why???
0
9641
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.