Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MR. Heath Stewart come in please

MR. Heath Stewart come in please

Scheduled Pinned Locked Moved C#
tutorialquestioncomhelplearning
12 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nakey_yang
    wrote on last edited by
    #1

    I found www.thecodeproject.com just before a week.Next week i asked a question "how to control web components in winform by embeding a browser(ie)" and i didn't thought so many people have took focus on it.So i am appriciated your help.But i am a beginner of programmer,so can you offer me a specific application example that is windows applicatin embeded a browser and we can draw Web componet such as TextBox on the browser interface?thank you for your help very much. myEmail:kiss1979@sohu.com ok

    H 1 Reply Last reply
    0
    • N nakey_yang

      I found www.thecodeproject.com just before a week.Next week i asked a question "how to control web components in winform by embeding a browser(ie)" and i didn't thought so many people have took focus on it.So i am appriciated your help.But i am a beginner of programmer,so can you offer me a specific application example that is windows applicatin embeded a browser and we can draw Web componet such as TextBox on the browser interface?thank you for your help very much. myEmail:kiss1979@sohu.com ok

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      I have an older example on a different site that I'm currently porting to CodeProject. Source is available from that site as well. The site itself bites.

      -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

      N 1 Reply Last reply
      0
      • H Heath Stewart

        I have an older example on a different site that I'm currently porting to CodeProject. Source is available from that site as well. The site itself bites.

        -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

        N Offline
        N Offline
        nakey_yang
        wrote on last edited by
        #3

        if i put a div element on the face of browser and set webconpontnet on the div, through this method can get the same result? ok

        H 1 Reply Last reply
        0
        • N nakey_yang

          if i put a div element on the face of browser and set webconpontnet on the div, through this method can get the same result? ok

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          No, you have to use the <object> tag. Please read my article and for more details, see Deploying a Runtime Application in Internet Explorer[^] in MSDN. If you give the control and ID and you create a class interface for the control that uses [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] attribute (on ther interface), with [ClassInterface(InterfaceType.None)] on the control (which implements the class interface as the first interface), you can access properties and call methods on the control like any other ActiveX controls. You should not use InterfaceType.AutoDual or InterfaceType.AutoDispatch for the class interface. See Nick Parker's Creating a CCW for COM-enabled non-.NET Applications[^] for more details.

          -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

          N 1 Reply Last reply
          0
          • H Heath Stewart

            No, you have to use the <object> tag. Please read my article and for more details, see Deploying a Runtime Application in Internet Explorer[^] in MSDN. If you give the control and ID and you create a class interface for the control that uses [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] attribute (on ther interface), with [ClassInterface(InterfaceType.None)] on the control (which implements the class interface as the first interface), you can access properties and call methods on the control like any other ActiveX controls. You should not use InterfaceType.AutoDual or InterfaceType.AutoDispatch for the class interface. See Nick Parker's Creating a CCW for COM-enabled non-.NET Applications[^] for more details.

            -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

            N Offline
            N Offline
            nakey_yang
            wrote on last edited by
            #5

            I know you mean,that is use winform control in web application.The method just as using ActiveX in web. But the .net framework is required in client. Did you mean we can move the control in web using the method you tell about a week ago? thank you!

            H 1 Reply Last reply
            0
            • N nakey_yang

              I know you mean,that is use winform control in web application.The method just as using ActiveX in web. But the .net framework is required in client. Did you mean we can move the control in web using the method you tell about a week ago? thank you!

              H Offline
              H Offline
              Heath Stewart
              wrote on last edited by
              #6

              Of course an embedded Windows Forms control requires the .NET Framework to be installed on the client, just like Java applets require a JRE and ActiveX requires IE. If you read my article, you'd see that this is treating a Windows Forms control in a similar fashion to an ActiveX control (it uses the <object> tag with a different classid value), and it can be scripted so long as the control uses dispatch interfaces (automation) that are exposed to the scripting host. It's all in my article. Note, though, that this has nothing to do with ASP.NET. It can be embedded into plain HTML documents, ASP, PHP, or anything, since it is completely client-side.

              -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

              N 1 Reply Last reply
              0
              • H Heath Stewart

                Of course an embedded Windows Forms control requires the .NET Framework to be installed on the client, just like Java applets require a JRE and ActiveX requires IE. If you read my article, you'd see that this is treating a Windows Forms control in a similar fashion to an ActiveX control (it uses the <object> tag with a different classid value), and it can be scripted so long as the control uses dispatch interfaces (automation) that are exposed to the scripting host. It's all in my article. Note, though, that this has nothing to do with ASP.NET. It can be embedded into plain HTML documents, ASP, PHP, or anything, since it is completely client-side.

                -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

                N Offline
                N Offline
                nakey_yang
                wrote on last edited by
                #7

                i see. Now i am designing a application that enable users as server side can configurate some componets on the platform (just a winapplication embedded browser i said first time) the users as client side can watch the results.As you know the client side should comunication with server realtime to get data. Cmmonly we can refresh the browser to link to the server to get data,but when application need do this per 2 second this method cann't been used.Now i am confused about whether to design web components(how keep communicaion between server and client in background process) or winform component (use DCOM to keep their communicaion?anyother method?) .So, please give me some advice. thank you. 非常感谢您的帮助

                H 1 Reply Last reply
                0
                • N nakey_yang

                  i see. Now i am designing a application that enable users as server side can configurate some componets on the platform (just a winapplication embedded browser i said first time) the users as client side can watch the results.As you know the client side should comunication with server realtime to get data. Cmmonly we can refresh the browser to link to the server to get data,but when application need do this per 2 second this method cann't been used.Now i am confused about whether to design web components(how keep communicaion between server and client in background process) or winform component (use DCOM to keep their communicaion?anyother method?) .So, please give me some advice. thank you. 非常感谢您的帮助

                  H Offline
                  H Offline
                  Heath Stewart
                  wrote on last edited by
                  #8

                  Web Controls are merely server-side controls that are rendered as HTML. This would still require that the client refreshes the browser, or that you initialize a timer with a 2-second delay, or that you use the HTTP header "refresh" (or a META tag using http-equiv="refresh") with the value "timeout;url", where timeout is set to 2 and the url is the same page. If you use a Windows Forms control, you could use XML Web Service, Remoting, or Enterprise Services (DCOM) to communicate in real-time with the backend with the user needing to do anything, but the client should still poll for data (if using remoting hosted by IIS) because any remoting object hosted by IIS is configured as a Web Service and - because of the HTTP protocol - can only communicate one way (from client to server).

                  -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

                  N 1 Reply Last reply
                  0
                  • H Heath Stewart

                    Web Controls are merely server-side controls that are rendered as HTML. This would still require that the client refreshes the browser, or that you initialize a timer with a 2-second delay, or that you use the HTTP header "refresh" (or a META tag using http-equiv="refresh") with the value "timeout;url", where timeout is set to 2 and the url is the same page. If you use a Windows Forms control, you could use XML Web Service, Remoting, or Enterprise Services (DCOM) to communicate in real-time with the backend with the user needing to do anything, but the client should still poll for data (if using remoting hosted by IIS) because any remoting object hosted by IIS is configured as a Web Service and - because of the HTTP protocol - can only communicate one way (from client to server).

                    -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

                    N Offline
                    N Offline
                    nakey_yang
                    wrote on last edited by
                    #9

                    Now,i am decided to design Web component.Just as you say above if we design winfrom component we can use web servers,DCOM and so on,but when i do web component,how can i keep communication between client and server don't use to refresh.For example when i use DataGrid web component ,how can i update its data in client side without using refresh to connect to server side. 感谢你的帮助!!!

                    H 1 Reply Last reply
                    0
                    • N nakey_yang

                      Now,i am decided to design Web component.Just as you say above if we design winfrom component we can use web servers,DCOM and so on,but when i do web component,how can i keep communication between client and server don't use to refresh.For example when i use DataGrid web component ,how can i update its data in client side without using refresh to connect to server side. 感谢你的帮助!!!

                      H Offline
                      H Offline
                      Heath Stewart
                      wrote on last edited by
                      #10

                      The important thing to remember is that the web browser is not communicating the with server. The server nearly sent the browser a page that contains an embedded object. That object communicates directly with the server as any other application - either embedded or standalone - would, using remoting, DCOM, or whatever. This is up to the implementation.

                      -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

                      N 1 Reply Last reply
                      0
                      • H Heath Stewart

                        The important thing to remember is that the web browser is not communicating the with server. The server nearly sent the browser a page that contains an embedded object. That object communicates directly with the server as any other application - either embedded or standalone - would, using remoting, DCOM, or whatever. This is up to the implementation.

                        -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

                        N Offline
                        N Offline
                        nakey_yang
                        wrote on last edited by
                        #11

                        thanks you!Now the thing confused my head is that my web component can changed its surface when the data it bound to,but how can i make the same change apperaed in client connected with the server? 您的帮助将使我受益匪浅!

                        H 1 Reply Last reply
                        0
                        • N nakey_yang

                          thanks you!Now the thing confused my head is that my web component can changed its surface when the data it bound to,but how can i make the same change apperaed in client connected with the server? 您的帮助将使我受益匪浅!

                          H Offline
                          H Offline
                          Heath Stewart
                          wrote on last edited by
                          #12

                          Here's an ASCII chart:

                          Web Browser (client) -> Request -> HTTP Server (server)
                          client <- Response <- server
                           
                          Embedded Control (client) <-> DCOM/Remoting Server (server)

                          Notice how the embedded control can communicate BOTH ways with the DCOM or Remoting server? See, you're missing the crutial point here and you must understand this or you're really in trouble. HTTP communication is essentially one way. Yes, the browser requests information from the server and the server sends it out, but the server cannot send out information without a request from a client application. For what you need, you are EMBEDDING a control in a Web page (which requires no refreshing of the web browser - think of it as a stand-alone appliation that just sits there) that talks directly with a DCOM or Remoting server on the server. If the client is not firewalled, the DCOM or Remoting service can make calls on the client as well. It's two-way communication. For a web browser, if you need to refresh data, you either have to have a javascript or browser behavior fetch data behind the scenes and update the DHTML page (or an ActiveX control or Java applet doing it in the foreground), or you have to refresh the page itself either using some javascript with a timer and window.location.reload(), or use the HTTP-EQUIV="refresh" META tag with the content="timeout;url" syntax. This is all in the MSDN Library and you should read it and understand this basic concept of the Web before you venture down a page blindly. It's crucial.

                          -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups