How do I make a HTTP (POST) call to DLL to make HTML?

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

    How do I make a HTTP (POST) call to DLL to make HTML?

    In some applications you see a HTML page in the Web-browser call a DLL
    instead of a .asp page.
    The result is HTML presented in the browser.

    I have seen this working for stand-alone apps as well (Internet Explorer
    does the same)

    == Questions
    1) How does this work?
    2) How do I set up the VB code inside the DLL to recieve and handle the
    HTTP-call?
    3) Is there any sample code available showing me the basics? (A VB project,
    or "whitepaper s")
    4) Dou you recommend .NET or VB 6.0?

    == Why?
    I want create a small desktop application using HTML-pages to present data
    and to present forms.
    Via POST, data should be stored via the DLL into a database

    == What for?
    Applications to be distributed to desktops using Win 98, WinXP and Win2000

    Thanks in advance.

    Peter


  • Cor

    #2
    Re: How do I make a HTTP (POST) call to DLL to make HTML?

    Hi Peter,

    Peter,

    This is not easy to answer, because you are asking so much and so different,
    while reading it I get more and more the idea that you are mixing up things.

    However, just new, this week is this link; maybe it is something for you?

    Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


    Cor






    Comment

    • Peter Kaptein

      #3
      Re: How do I make a HTTP (POST) call to DLL to make HTML?

      > However, just new, this week is this link; maybe it is something for you?[color=blue]
      > http://msdn.microsoft.com/asp.net/asprk/default.aspx[/color]

      I have to buy books anyway.
      [color=blue]
      > while reading it I get more and more the idea that you are mixing up[/color]
      things.

      Reviewing things I think my question is confusing and unclear.

      == VB6
      4 years ago I have worked on a VB application built by someone else: saved
      as EXE of DLL (i do not recall)

      Instead of calling "<website>/thePage.asp?<pa rameters>"
      the webpages called for "<website>/theDLL?<paramet ers>"

      Then the DLL returned a HTML-page generated on the fly
      IE does the same when a URL can not be resolved.

      Inside the DLL there was some kind of "service" catching off the
      "?<paramete rs>" bit.

      I do not know how they did it.

      == .NET
      Searching the web for .NET solution I found an example using VB.NET to
      present a browserwindow and catching off the "beforeNavigate 2" event,
      sending a "cancel=tru e" back and redirecting things somehow to a file
      published by the VB.NET code using the ASPX "engine"

      That is close, but not entirely what I have in mind.

      "Cor" <non@non.com> wrote in message
      news:#CgFNDoAEH A.1468@tk2msftn gp13.phx.gbl...[color=blue]
      > Hi Peter,
      >
      > Peter,
      >
      > This is not easy to answer, because you are asking so much and so[/color]
      different,[color=blue]
      > while reading it I get more and more the idea that you are mixing up[/color]
      things.[color=blue]
      >
      > However, just new, this week is this link; maybe it is something for you?
      >
      > http://msdn.microsoft.com/asp.net/asprk/default.aspx
      >
      > Cor[/color]


      Comment

      • Peter Kaptein

        #4
        Better formulated

        == What I want to do:
        1) Use HTML instead of the VB forms to present my User Interfaces inside
        applications that can run on "any" desktop running Win98 and higher.
        2) Run the User Interface inside a WebBrowser

        == What is the best approach?
        Does anyone have any experience on how to do this?
        (Even parse .ASP or .ASPX scripts on clients?)

        == Have I built apps with HTML frontends before?
        Yes. .
        I build Web-applications running on IIS to:
        1) Maintain the content of databases
        2) Zip and unzip large files on remote machines
        3) Maintain files on remote machines
        4) Publish database-content to static files.

        Business logic is stored in DLLs and called via
        server.CreateOb ject("theDLLref errerName.Class Name")

        == Why on desktops?
        HTML and DHTML offer me much more flexibility in building self-adapting user
        interfaces.

        A new version of a desktop app. to be developed for one of my clients will
        run based on 3-tier architecture using HTML for the presentation layer, VB
        for the Business Layer and MS Access for the Database Layer.


        Comment

        • Cor

          #5
          Re: How do I make a HTTP (POST) call to DLL to make HTML?

          Hi Peter,

          There are two possibilities; one is that they made a Com project (they did
          it themselves).

          However according to the date you give, I think it is not impossible the
          made a VB6 IIS project (I thought the name was) it worked nice, however it
          had a lot of bugs and when you did look to it, it seems to me that it could
          only become buggier. Microsoft has stopped that, as far as I know had it
          never updates.

          Nevertheless, they came back with dotNet. In my opinion is the whole ASPNet
          a much more and better implementation from that IIS solution.

          It makes also DLL's (when you use visual.studio.n et) but it is much more
          complete, have a look at that resource kit I from which I have given you
          that link


          I hope this helps?

          Cor


          Comment

          • Azeus

            #6
            Re: How do I make a HTTP (POST) call to DLL to make HTML?

            What you mean is this?

            res://mshtml.dll/repost.htm

            This is a resource dll. Microsoft dustributes these so that they can have
            localized versions of their products
            without making separate builds for each language.

            In a DLL or executable you can include resources such as bitmaps, icons,
            toolbars, string resources, html pages and xml forms.
            This way you don't have to store the file separately with the risk of them
            being deleted while there's such a high
            dependency on them.

            I don't know how to create one in VB since I cannot find anything that
            resembles the resource in C++.


            Comment

            • Azeus

              #7
              Re: How do I make a HTTP (POST) call to DLL to make HTML?

              Ok, I located the VB Resource Editor Add-in. I added an html file as
              resource
              but I couldn't load it using the res:// prefix.


              "Azeus" <azizerrafay@NO SPAM_DAMNED_hot mail.com> wrote in message
              news:404d943b$0 $558$e4fe514c@n ews.xs4all.nl.. .[color=blue]
              > What you mean is this?
              >
              > res://mshtml.dll/repost.htm
              >
              > This is a resource dll. Microsoft dustributes these so that they can have
              > localized versions of their products
              > without making separate builds for each language.
              >
              > In a DLL or executable you can include resources such as bitmaps, icons,
              > toolbars, string resources, html pages and xml forms.
              > This way you don't have to store the file separately with the risk of them
              > being deleted while there's such a high
              > dependency on them.
              >
              > I don't know how to create one in VB since I cannot find anything that
              > resembles the resource in C++.
              >
              >[/color]


              Comment

              • Peter Kaptein

                #8
                Re: How do I make a HTTP (POST) call to DLL to make HTML?

                > It makes also DLL's (when you use visual.studio.n et) but it is much more[color=blue]
                > complete, have a look at that resource kit I from which I have given you
                > that link[/color]

                I will.

                == Another way found
                An intermediate solution I found presents the browser component of MS
                Internet Explorer and intercepts the Navigate2 event: I did not test it on a
                Desktop-machine yet.


                I do believe this is one way to go, also since it is possible to use the
                functionalities of ASP.NET (in-page processing) with the speed of optimized
                pardser-code.

                You do not need to run it via IIS / "http:/ /<webserver>/page.aspx", which
                is one target reached.

                It apparently places a result-file on the Harddrive to return the result to
                the browser.

                == Parsing the result directly to the browser
                Another way I am investigating is to somehow return parsed XML / XSL code
                directly to the browser. (Another post: to some Internet Explorer
                newsgroups.)
                Saving it as a file seems a little bit strange to me. (But then again: if it
                works, it works!)

                "Cor" <non@non.com> wrote in message
                news:e2WC95NBEH A.3776@tk2msftn gp13.phx.gbl...[color=blue]
                > Hi Peter,
                >
                > There are two possibilities; one is that they made a Com project (they did
                > it themselves).
                >[/color]


                Comment

                • gel987

                  #9
                  Re: How do I make a HTTP (POST) call to DLL to make HTML?

                  In article <e2WC95NBEHA.37 76@tk2msftngp13 .phx.gbl>, non@non.com says...[color=blue]
                  >
                  >Hi Peter,
                  >
                  >There are two possibilities; one is that they made a Com project (they did
                  >it themselves).
                  >
                  >However according to the date you give, I think it is not impossible the
                  >made a VB6 IIS project (I thought the name was) it worked nice, however it
                  >had a lot of bugs and when you did look to it, it seems to me that it could
                  >only become buggier. Microsoft has stopped that, as far as I know had it
                  >never updates.
                  >
                  >Nevertheless , they came back with dotNet. In my opinion is the whole ASPNet
                  >a much more and better implementation from that IIS solution.
                  >
                  >It makes also DLL's (when you use visual.studio.n et) but it is much more
                  >complete, have a look at that resource kit I from which I have given you
                  >that link
                  >
                  >
                  >I hope this helps?
                  >
                  >Cor
                  >
                  >[/color]

                  $B!!$&$&$`!#$= $&$G$9$+!#(B

                  Comment

                  • dev35
                    New Member
                    • Jul 2006
                    • 1

                    #10
                    Here is a complete and simple example easy to use

                    ****in your vb6 class*****

                    Option Explicit

                    Dim DataConn As ADODB.Connectio n
                    Dim rs As ADODB.Recordset
                    Dim Session As Session
                    Dim Application As Application
                    Dim Request As Request
                    Dim Response As Response
                    Dim Server As Server


                    Public Sub OnStartPage(SC As ScriptingContex t)
                    Set Session = SC.Session
                    Set Application = SC.Application
                    Set Request = SC.Request
                    Set Response = SC.Response
                    Set Server = SC.Server
                    Set DataConn = Server.CreateOb ject("ADODB.Con nection")

                    DataConn.Open Application("My DataBase") ' Connection string

                    End Sub

                    Public Sub OnEndPage()
                    Set Session = Nothing
                    Set Application = Nothing
                    Set Request = Nothing
                    Set Response = Nothing
                    Set Server = Nothing
                    DataConn.Close
                    Set DataConn = Nothing
                    End Sub

                    Public Sub Execution()
                    '////Return somethings ...
                    Response.Write "<html>"
                    Response.Write "<body>"

                    Response.Write Request.ServerV ariables("scrip t_name")
                    Response.Write "<br>"
                    Response.Write Request.ServerV ariables("Serve r_name")
                    Response.Write "<br>"

                    Set rs = DataConn.Execut e("select Myfield from MyTable")
                    Do While Not rs.EOF
                    Response.Write rs("Myfield") & "<br>" & vbCrLf
                    rs.MoveNext
                    Loop
                    rs.Close
                    Set rs = Nothing

                    Response.Write "</body>"
                    Response.Write "</html>"

                    End Sub

                    ****in your asp page*****
                    <%
                    Set Page = Server.CreateOb ject("MyProject .MyClass")
                    Page.Execution( )
                    set Page = nothing
                    %>

                    **** That's it*****
                    Hope this helps

                    Comment

                    Working...