Microsoft Web Browser COM control in VB .Net

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • BobAchgill

    Microsoft Web Browser COM control in VB .Net

    Has anyone had success with using this Com control?

    When I add it into my tool box and drop it into my form
    it says in the
    properties that the Document and LocationURL are read
    only. (they are grayed out)

    I am successful to get Media Play Com to work alright in
    the form but can
    not get Web Browser to work.

    Maybe you can tell me there is another way to get HTML
    browsing capability
    inside a form?

    I found a link on Google that seemed to be referencing
    this issue but could
    not get their code to compile

    x

  • Cor

    #2
    Re: Microsoft Web Browser COM control in VB .Net

    There is a difference between the adWebbrowser and the webbrowser

    axshdocVw.dll and shdocVw.dll and only shdocVW.dll, are you using axshdocvw?

    Cor


    Comment

    • Cor

      #3
      Re: Microsoft Web Browser COM control in VB .Net

      There is a difference between the adWebbrowser and the webbrowser

      axshdocVw.dll and shdocVw.dll and only shdocVW.dll, are you using axshdocvw?

      Cor


      Comment

      • BobAchgill

        #4
        Re: Microsoft Web Browser COM control in VB .Net

        When I run the form with a Microsoft Web Browser
        (shdocVw.dll ) i only get a white box. It is not obvious
        how to feed the browser box an HTML file to read.

        I searched on my drives and did not find a axshdocVw.dll.

        I searched in the COM list and did not see an
        adWebbrowser... is this a third party COM? If it is what
        I need to finish the task...where to I get it?


        If there are two methods for getting a browser control in
        a form: Microsoft Web Browser AND AdWebbrowser...
        What are the advantages of each?
        [color=blue]
        >-----Original Message-----
        >There is a difference between the adWebbrowser and the[/color]
        webbrowser[color=blue]
        >
        >axshdocVw.dl l and shdocVw.dll and only shdocVW.dll, are[/color]
        you using axshdocvw?[color=blue]
        >
        >Cor
        >
        >
        >.
        >[/color]

        Comment

        • BobAchgill

          #5
          Re: Microsoft Web Browser COM control in VB .Net

          When I run the form with a Microsoft Web Browser
          (shdocVw.dll ) i only get a white box. It is not obvious
          how to feed the browser box an HTML file to read.

          I searched on my drives and did not find a axshdocVw.dll.

          I searched in the COM list and did not see an
          adWebbrowser... is this a third party COM? If it is what
          I need to finish the task...where to I get it?


          If there are two methods for getting a browser control in
          a form: Microsoft Web Browser AND AdWebbrowser...
          What are the advantages of each?
          [color=blue]
          >-----Original Message-----
          >There is a difference between the adWebbrowser and the[/color]
          webbrowser[color=blue]
          >
          >axshdocVw.dl l and shdocVw.dll and only shdocVW.dll, are[/color]
          you using axshdocvw?[color=blue]
          >
          >Cor
          >
          >
          >.
          >[/color]

          Comment

          • Cor

            #6
            Re: CHARLES LAW your assistent needed

            Hi Bob,

            I never got things working with the shdocvw.dll the axdocvw.dll is I think
            the compatible part from VB6 I put in the subject Charles than maybe Charles
            can sees it and he can tell us what he is using.

            Cor


            Comment

            • Cor

              #7
              Re: CHARLES LAW your assistent needed

              Hi Bob,

              I never got things working with the shdocvw.dll the axdocvw.dll is I think
              the compatible part from VB6 I put in the subject Charles than maybe Charles
              can sees it and he can tell us what he is using.

              Cor


              Comment

              • Charles Law

                #8
                Re: CHARLES LAW your assistent needed

                Hi Cor, Bob

                Sorry, I was miles away (figuratively speaking).

                Bob ...

                The WebBrowser control is an ActiveX control, so when you add one to a form
                in your .NET project, .NET adds a managed wrapper to it, which is what the
                ax prefix means.

                Once you have a WebBrowser control on your form, you will see
                AxInterop.SHDoc Vw and Microsoft.mshtm l in the project references, in the
                solution explorer. The former is concerned with the user interface and the
                latter is concerned with the DOM.

                The reason Document is greyed out, for example, is that it is an object that
                provides access to the DOM. Its primary interface is mshtml.IHTMLDoc ument2,
                but you can use DirectCast to get at other supported interfaces.

                In the simplest case, suppose you want to navigate to an HTML page: in the
                load event of your form put

                AxWebBrowser1.N avigate2("http://www.microsoft.c om")

                for example, to go to the Microsoft home page. Be aware that the page loads
                asynchronously, so the call to Navigate2() will return immediately, and
                certainly before the page has finished loading. If you want to access the
                document you will need to handle the DocumentComplet e event of the browser
                control, or wait until the readyState = "complete".

                Sorry if this is a bit brief, but have a go, and post back with any further
                problems.

                HTH

                Charles





                "Cor" <non@non.com> wrote in message
                news:uyPBJjKHEH A.3564@TK2MSFTN GP09.phx.gbl...[color=blue]
                > Hi Bob,
                >
                > I never got things working with the shdocvw.dll the axdocvw.dll is I think
                > the compatible part from VB6 I put in the subject Charles than maybe[/color]
                Charles[color=blue]
                > can sees it and he can tell us what he is using.
                >
                > Cor
                >
                >[/color]


                Comment

                • Charles Law

                  #9
                  Re: CHARLES LAW your assistent needed

                  Hi Cor, Bob

                  Sorry, I was miles away (figuratively speaking).

                  Bob ...

                  The WebBrowser control is an ActiveX control, so when you add one to a form
                  in your .NET project, .NET adds a managed wrapper to it, which is what the
                  ax prefix means.

                  Once you have a WebBrowser control on your form, you will see
                  AxInterop.SHDoc Vw and Microsoft.mshtm l in the project references, in the
                  solution explorer. The former is concerned with the user interface and the
                  latter is concerned with the DOM.

                  The reason Document is greyed out, for example, is that it is an object that
                  provides access to the DOM. Its primary interface is mshtml.IHTMLDoc ument2,
                  but you can use DirectCast to get at other supported interfaces.

                  In the simplest case, suppose you want to navigate to an HTML page: in the
                  load event of your form put

                  AxWebBrowser1.N avigate2("http://www.microsoft.c om")

                  for example, to go to the Microsoft home page. Be aware that the page loads
                  asynchronously, so the call to Navigate2() will return immediately, and
                  certainly before the page has finished loading. If you want to access the
                  document you will need to handle the DocumentComplet e event of the browser
                  control, or wait until the readyState = "complete".

                  Sorry if this is a bit brief, but have a go, and post back with any further
                  problems.

                  HTH

                  Charles





                  "Cor" <non@non.com> wrote in message
                  news:uyPBJjKHEH A.3564@TK2MSFTN GP09.phx.gbl...[color=blue]
                  > Hi Bob,
                  >
                  > I never got things working with the shdocvw.dll the axdocvw.dll is I think
                  > the compatible part from VB6 I put in the subject Charles than maybe[/color]
                  Charles[color=blue]
                  > can sees it and he can tell us what he is using.
                  >
                  > Cor
                  >
                  >[/color]


                  Comment

                  • Cor

                    #10
                    Re: CHARLES LAW your assistent needed

                    Hi Charles,

                    The main problem is that I never could use the Shdocvw (when I did want all
                    the benefits) directly but always the axshdocvw.

                    (And maybe a little bit lazy when I saw it did not go and the axshdovw did
                    work fine, not check it really very deep)

                    How is that with you, do you use the Shdocvw withouth the AxShdocvw.

                    Cor


                    Comment

                    • Cor

                      #11
                      Re: CHARLES LAW your assistent needed

                      Hi Charles,

                      The main problem is that I never could use the Shdocvw (when I did want all
                      the benefits) directly but always the axshdocvw.

                      (And maybe a little bit lazy when I saw it did not go and the axshdovw did
                      work fine, not check it really very deep)

                      How is that with you, do you use the Shdocvw withouth the AxShdocvw.

                      Cor


                      Comment

                      • Charles Law

                        #12
                        Re: CHARLES LAW your assistent needed

                        Hi Cor

                        No I don't. I have found it easier to use the RCW that .NET creates. In
                        order to make SHDocVw work on its own, there are several interfaces that
                        need to be implemented by the host, and these are not defined in the
                        framework, so they need to be created by hand. When .NET creates the RCW it
                        uses an AxHost as the container for SHDocVw, which takes care of all the
                        extra interfaces required.

                        There are reasons why doing it all by hand is beneficial, but I have managed
                        to get round the problems like events not firing by other means.

                        Charles


                        "Cor" <non@non.com> wrote in message
                        news:%23GaiBBLH EHA.3536@TK2MSF TNGP12.phx.gbl. ..[color=blue]
                        > Hi Charles,
                        >
                        > The main problem is that I never could use the Shdocvw (when I did want[/color]
                        all[color=blue]
                        > the benefits) directly but always the axshdocvw.
                        >
                        > (And maybe a little bit lazy when I saw it did not go and the axshdovw did
                        > work fine, not check it really very deep)
                        >
                        > How is that with you, do you use the Shdocvw withouth the AxShdocvw.
                        >
                        > Cor
                        >
                        >[/color]


                        Comment

                        • Charles Law

                          #13
                          Re: CHARLES LAW your assistent needed

                          Hi Cor

                          No I don't. I have found it easier to use the RCW that .NET creates. In
                          order to make SHDocVw work on its own, there are several interfaces that
                          need to be implemented by the host, and these are not defined in the
                          framework, so they need to be created by hand. When .NET creates the RCW it
                          uses an AxHost as the container for SHDocVw, which takes care of all the
                          extra interfaces required.

                          There are reasons why doing it all by hand is beneficial, but I have managed
                          to get round the problems like events not firing by other means.

                          Charles


                          "Cor" <non@non.com> wrote in message
                          news:%23GaiBBLH EHA.3536@TK2MSF TNGP12.phx.gbl. ..[color=blue]
                          > Hi Charles,
                          >
                          > The main problem is that I never could use the Shdocvw (when I did want[/color]
                          all[color=blue]
                          > the benefits) directly but always the axshdocvw.
                          >
                          > (And maybe a little bit lazy when I saw it did not go and the axshdovw did
                          > work fine, not check it really very deep)
                          >
                          > How is that with you, do you use the Shdocvw withouth the AxShdocvw.
                          >
                          > Cor
                          >
                          >[/color]


                          Comment

                          • BobAchgill

                            #14
                            Re: Microsoft Web Browser COM control in VB .Net

                            I looked at the Navigate ( ) Method but it was not clear
                            how or if that is what I need to direct the Web Browswer
                            control to point to read an HTML file.

                            You guys are so smart...pleeeas e share with me how you
                            get the Microsoft Web Browser (shdocVw.dll) to read a
                            file with in a VB form. I am still looking at a white
                            space where the control is painted on my form.



                            [color=blue]
                            >-----Original Message-----
                            >When I run the form with a Microsoft Web Browser
                            >(shdocVw.dll ) i only get a white box. It is not[/color]
                            obvious[color=blue]
                            >how to feed the browser box an HTML file to read.
                            >
                            >I searched on my drives and did not find a axshdocVw.dll.
                            >
                            >I searched in the COM list and did not see an
                            >adWebbrowser.. . is this a third party COM? If it is[/color]
                            what[color=blue]
                            >I need to finish the task...where to I get it?
                            >
                            >
                            >If there are two methods for getting a browser control[/color]
                            in[color=blue]
                            >a form: Microsoft Web Browser AND AdWebbrowser...
                            >What are the advantages of each?
                            >[color=green]
                            >>-----Original Message-----
                            >>There is a difference between the adWebbrowser and the[/color]
                            >webbrowser[color=green]
                            >>
                            >>axshdocVw.d ll and shdocVw.dll and only shdocVW.dll, are[/color]
                            >you using axshdocvw?[color=green]
                            >>
                            >>Cor
                            >>
                            >>
                            >>.
                            >>[/color]
                            >.
                            >[/color]

                            Comment

                            • BobAchgill

                              #15
                              Re: Microsoft Web Browser COM control in VB .Net

                              I looked at the Navigate ( ) Method but it was not clear
                              how or if that is what I need to direct the Web Browswer
                              control to point to read an HTML file.

                              You guys are so smart...pleeeas e share with me how you
                              get the Microsoft Web Browser (shdocVw.dll) to read a
                              file with in a VB form. I am still looking at a white
                              space where the control is painted on my form.



                              [color=blue]
                              >-----Original Message-----
                              >When I run the form with a Microsoft Web Browser
                              >(shdocVw.dll ) i only get a white box. It is not[/color]
                              obvious[color=blue]
                              >how to feed the browser box an HTML file to read.
                              >
                              >I searched on my drives and did not find a axshdocVw.dll.
                              >
                              >I searched in the COM list and did not see an
                              >adWebbrowser.. . is this a third party COM? If it is[/color]
                              what[color=blue]
                              >I need to finish the task...where to I get it?
                              >
                              >
                              >If there are two methods for getting a browser control[/color]
                              in[color=blue]
                              >a form: Microsoft Web Browser AND AdWebbrowser...
                              >What are the advantages of each?
                              >[color=green]
                              >>-----Original Message-----
                              >>There is a difference between the adWebbrowser and the[/color]
                              >webbrowser[color=green]
                              >>
                              >>axshdocVw.d ll and shdocVw.dll and only shdocVW.dll, are[/color]
                              >you using axshdocvw?[color=green]
                              >>
                              >>Cor
                              >>
                              >>
                              >>.
                              >>[/color]
                              >.
                              >[/color]

                              Comment

                              Working...