Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Internet Explorer Addon

Reply
Thread Tools

Internet Explorer Addon

 
 
kitkatrobins
Guest
Posts: n/a
 
      10-24-2007
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

 
Reply With Quote
 
 
 
 
zhangyw80@yahoo.com.cn
Guest
Posts: n/a
 
      10-24-2007
On 10 24 , 6 16 , kitkatrobins <kitkat_rob...@hotmail.com> wrote:
> 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;

 
Reply With Quote
 
 
 
 
zhangyw80@yahoo.com.cn
Guest
Posts: n/a
 
      10-24-2007
On 10 24 , 6 16 , kitkatrobins <kitkat_rob...@hotmail.com> wrote:
> 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;

 
Reply With Quote
 
kitkatrobins
Guest
Posts: n/a
 
      10-24-2007
On Oct 24, 11:54 am, zhangy...@yahoo.com.cn wrote:
> On 10 24 , 6 16 , kitkatrobins <kitkat_rob...@hotmail.com> wrote:
>
> > 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;


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.


 
Reply With Quote
 
Alf P. Steinbach
Guest
Posts: n/a
 
      10-24-2007
* kitkatrobins:
> On Oct 24, 11:54 am, zhangy...@yahoo.com.cn wrote:
>> On 10 24 , 6 16 , kitkatrobins <kitkat_rob...@hotmail.com> wrote:
>>
>>> 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;

>
> 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.

>


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].


--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
 
Reply With Quote
 
Jack Klein
Guest
Posts: n/a
 
      10-25-2007
On Wed, 24 Oct 2007 03:16:01 -0700, kitkatrobins
<> wrote 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
 
Reply With Quote
 
kitkatrobins
Guest
Posts: n/a
 
      10-25-2007
On Oct 25, 3:26 am, Jack Klein <jackkl...@spamcop.net> wrote:
> On Wed, 24 Oct 2007 03:16:01 -0700, kitkatrobins
> <kitkat_rob...@hotmail.com> wrote 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?

 
Reply With Quote
 
jitesh81@gmail.com
Guest
Posts: n/a
 
      11-20-2007
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.
 
Reply With Quote
 
Alf P. Steinbach
Guest
Posts: n/a
 
      11-20-2007
* :
> [OT]


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

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer 8: C:\Program Files\Internet Explorer\iexplore.exe vs C:\Program Files (x86)\Internet Explorer\iexplore.exe Nathan Sokalski Windows 64bit 16 02-22-2010 08:31 AM
internet explorer 7 - Internet Explorer cannot display the webpag sandy j Windows 64bit 0 05-02-2009 02:12 AM
Addon / Utlity to Interrogate Cache Nho Whei Firefox 4 04-12-2007 08:39 AM
Addon etc for NT 4.0. workstation to easily login to Windows Servr 2003 Edward M Computer Support 2 09-19-2005 05:03 PM
How do I remove the Theme Installer Addon David Tangye Firefox 0 01-02-2004 07:40 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57