Internet Explorer Addon

Discussion in 'C++' started by kitkatrobins, Oct 24, 2007.

  1. kitkatrobins

    kitkatrobins Guest

    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
     
    kitkatrobins, Oct 24, 2007
    #1
    1. Advertising

  2. kitkatrobins

    Guest

    On 10 24 , 6 16 , kitkatrobins <> 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;
     
    , Oct 24, 2007
    #2
    1. Advertising

  3. kitkatrobins

    Guest

    On 10 24 , 6 16 , kitkatrobins <> 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;
     
    , Oct 24, 2007
    #3
  4. kitkatrobins

    kitkatrobins Guest

    On Oct 24, 11:54 am, wrote:
    > On 10 24 , 6 16 , kitkatrobins <> 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.
     
    kitkatrobins, Oct 24, 2007
    #4
  5. * kitkatrobins:
    > On Oct 24, 11:54 am, wrote:
    >> On 10 24 , 6 16 , kitkatrobins <> 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?
     
    Alf P. Steinbach, Oct 24, 2007
    #5
  6. kitkatrobins

    Jack Klein Guest

    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
     
    Jack Klein, Oct 25, 2007
    #6
  7. kitkatrobins

    kitkatrobins Guest

    On Oct 25, 3:26 am, Jack Klein <> wrote:
    > 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.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?
     
    kitkatrobins, Oct 25, 2007
    #7
  8. kitkatrobins

    Guest

    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, 2007
    #8
  9. * :
    > [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?
     
    Alf P. Steinbach, Nov 20, 2007
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cmay
    Replies:
    0
    Views:
    1,164
  2. Ed Hauptman
    Replies:
    7
    Views:
    1,074
    Ed Hauptman
    Aug 7, 2009
  3. timo verbeek

    creating addon system

    timo verbeek, May 21, 2010, in forum: Python
    Replies:
    3
    Views:
    325
    timo verbeek
    May 22, 2010
  4. Amar Kapadia

    Utilities/Addon for Creating Tables

    Amar Kapadia, May 15, 2005, in forum: ASP .Net Web Controls
    Replies:
    6
    Views:
    144
    Amar Kapadia
    May 16, 2005
  5. John Smith
    Replies:
    1
    Views:
    164
    Evertjan.
    Mar 12, 2005
Loading...

Share This Page