473,395 Members | 1,574 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,395 software developers and data experts.

Internet Explorer Addon

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

Oct 24 '07 #1
6 3286
On 10 24 , 6 16 , kitkatrobins <kitkat_rob...@hotmail.comwrote:
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<IWebBrowser2pWebBrowser2 = pUnkSite;
then get URL through the LocationURL method of IWebBrowser2;
CComBSTR bstrUrl;
pWebBrowser2->get_LocationURL(&bstrUrl);
and now bstrUrl is what you need;

Oct 24 '07 #2
On 10 24 , 6 16 , kitkatrobins <kitkat_rob...@hotmail.comwrote:
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<IWebBrowser2pWebBrowser2 = pUnkSite;
then get URL through the LocationURL method of IWebBrowser2;
CComBSTR bstrUrl;
pWebBrowser2->get_LocationURL(&bstrUrl);
and now bstrUrl is what you need;

Oct 24 '07 #3
On Oct 24, 11:54 am, zhangy...@yahoo.com.cn wrote:
On 10 24 , 6 16 , kitkatrobins <kitkat_rob...@hotmail.comwrote:
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<IWebBrowser2pWebBrowser2 = 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-
>get_LocationURL(&bstrUrlName);" within the Exec method.
Oct 24 '07 #4
On Wed, 24 Oct 2007 03:16:01 -0700, kitkatrobins
<ki***********@hotmail.comwrote in comp.lang.c++:
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
Oct 25 '07 #5
On Oct 25, 3:26 am, Jack Klein <jackkl...@spamcop.netwrote:
On Wed, 24 Oct 2007 03:16:01 -0700, kitkatrobins
<kitkat_rob...@hotmail.comwrote in comp.lang.c++:
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.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?

Oct 25 '07 #6
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.
Nov 20 '07 #7

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

Similar topics

2
by: Raymond H. | last post by:
Hello, I create a vb4 project which can also naviger on Internet via the WebBrowser control which I put on my form. My question is: if this program is installed on a station having already...
2
by: CathieC | last post by:
I have a websote developed using visual studio 2005 beta , .net version 2 i deploy my application to a server and it is run from client computers. One of the users gets the error "Internet...
3
by: VK | last post by:
Internet Explorer 7 beta 2 preview CNET Editor review: <http://reviews.cnet.com/Internet_Explorer_7_for_XP_SP2_Beta_2/4505-3514_7-31454661-2.html?tag=nl.e415> Summary (my personal review...
11
by: Wendy | last post by:
Hello, I have a program that does the following: When a user clicks on a row in a VB.NET datagrid, it will open a web page in Internet Explorer (that corresponds to that item in the selected row...
0
by: spam | last post by:
I would like to create an addon that when a developer checks code into VSS from the .NET IDE, that it will automatically run an addon tool that they can then enter additional information about the...
3
by: laredotornado | last post by:
Hi, This problem only affects PC IE. On a secured page (a page visited via https), there is a link that reads -- "Download HTML File". The link connects to this page <?php...
9
by: Etayki | last post by:
Hi! I am new to VB.net and I am using the Visual Basic 2005 Express Edition I have two questions: 1. I am trying to write an application that will automate Internet Explorer and store data...
1
by: -Lost | last post by:
This is more of a post to inform, unless of course I am missing something fundamental, in which case I would appreciate anyone explaining it. Based on Mr. Michaux's camelizeStyle function I...
7
by: Danny | last post by:
Hello: I would like to develop a browser extension, or whatever such a thing is classified as, that would allow a user of IE6, and possibly IE7, to switch between a live and development page. ...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.