Internet Explorer Addon

K

kitkatrobins

Hi,

I am creating an Internet Explorer add on. I am doing this using
Browser Help Objects in C++. I've been programming for many years but
mainly as a c# developer and have had little experience with C++.

I have got a basic add on into Internet Explorer, you press a button
it fires an event. Within this event I would like to get the current
URL. How do I do this?

Thanks in advance for any comments
 
Z

zhangyw80

Hi,

I am creating an Internet Explorer add on. I am doing this using
Browser Help Objects in C++. I've been programming for many years but
mainly as a c# developer and have had little experience with C++.

I have got a basic add on into Internet Explorer, you press a button
it fires an event. Within this event I would like to get the current
URL. How do I do this?

Thanks in advance for any comments

you can do this using the IUnknown *pUnkSite passed to you as the
argument of IObjectWithSite::SetSite;
First, Query the IWebBrowser2* interface pointer from pUnkSite;
CComQIPtr<IWebBrowser2> pWebBrowser2 = pUnkSite;
then get URL through the LocationURL method of IWebBrowser2;
CComBSTR bstrUrl;
pWebBrowser2->get_LocationURL(&bstrUrl);
and now bstrUrl is what you need;
 
Z

zhangyw80

Hi,

I am creating an Internet Explorer add on. I am doing this using
Browser Help Objects in C++. I've been programming for many years but
mainly as a c# developer and have had little experience with C++.

I have got a basic add on into Internet Explorer, you press a button
it fires an event. Within this event I would like to get the current
URL. How do I do this?

Thanks in advance for any comments

you can do this using the IUnknown *pUnkSite passed to you as the
argument of IObjectWithSite::SetSite;
First, Query the IWebBrowser2* interface pointer from pUnkSite;
CComQIPtr<IWebBrowser2> pWebBrowser2 = pUnkSite;
then get URL through the LocationURL method of IWebBrowser2;
CComBSTR bstrUrl;
pWebBrowser2->get_LocationURL(&bstrUrl);
and now bstrUrl is what you need;
 
K

kitkatrobins

you can do this using the IUnknown *pUnkSite passed to you as the
argument of IObjectWithSite::SetSite;
First, Query the IWebBrowser2* interface pointer from pUnkSite;
CComQIPtr<IWebBrowser2> pWebBrowser2 = pUnkSite;
then get URL through the LocationURL method of IWebBrowser2;
CComBSTR bstrUrl;
pWebBrowser2->get_LocationURL(&bstrUrl);
and now bstrUrl is what you need;

Hi,

I thought it was on those lines, however I seem to get the error
"Debug Assertion Failed! ...atlcomcli.h Line: 154, p != 0????

This error is raised when I try "HRESULT hr2 = m_spWebBrowser-
 
A

Alf P. Steinbach

* kitkatrobins:
Hi,

I thought it was on those lines, however I seem to get the error
"Debug Assertion Failed! ...atlcomcli.h Line: 154, p != 0????

This error is raised when I try "HRESULT hr2 = m_spWebBrowser-

This discussion is completely off-topic in clc++.

Please read the FAQ, in particular the items for newcomers to the group,
and please don't pollute the group.

Follow-ups set to [comp.os.ms-windows.programming.win32].
 
J

Jack Klein

Hi,

I am creating an Internet Explorer add on. I am doing this using
Browser Help Objects in C++. I've been programming for many years but
mainly as a c# developer and have had little experience with C++.

Many years? MANY? Microsoft released their first implementation in
2001, so you are talking 6 years at most. That's MANY???

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
 
K

kitkatrobins

Many years? MANY? Microsoft released their first implementation in
2001, so you are talking 6 years at most. That's MANY???

--
Jack Klein
Home:http://JK-Technology.Com
FAQs for
comp.lang.chttp://c-faq.com/
comp.lang.c++http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html

No, I have other programming languages I've worked with for many
years, just c++ one I've little experience with. I was just giving an
intro. Why make so much of it?
 
J

jitesh81

Hi,
Even I am looking for same type of application. I created a button on
IE toolbar. Clicking on that button I would like to get current url of
browser. If you find the solutions can u plz post me on that. I will
be really thankfull.
 
A

Alf P. Steinbach

* (e-mail address removed):

While your post is off-topic because it did not actually ask or answer a
C++ question, please do not feel unwelcome. The best way to introduce
yourself here after you have spent time just reading other people's
posts (to get a feel for the group) is to either post a C++ question or
to try answering someone else's. The group's FAQ contains a wealth of
useful information, including advice on topicality and how to post.

Cheers, & hth.,

- Alf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top