Using HTML as an application GUI or How do you control an application from Javascript?

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

    #1

    Using HTML as an application GUI or How do you control an application from Javascript?

    I'm currently developing an application in C++/MFC (Visual Studio 6,
    if that makes a difference) and I'd like to avoid the Windows style UI
    widgets and dialogs if at all possible.

    In fact, what I'd really like to do is use HTML/web pages as the user
    interface and invoke my application in the background to do the heavy
    lifting. I'm fairly well experienced with web pages and I've written
    a fair amount of JavaScript at one time or another (I taught several
    undergrad courses using it actually) but I don't know anything about
    its capabilities when it comes to interfacing with or controlling
    external applications.

    I'll likely be running IE on a Windows box (you can put it into full
    screen no-toolbar mode) and here's the question: Can I use client-side
    javascript to invoke and/or control my application? I know that
    normally javascript can't play outside its own sandbox (i.e. no
    filesystem access etc.) for security reasons, but I've seen in the MS
    JScript documentation that it's possible to use something called
    'unsafe' mode. And since it will only be using web pages on the local
    file system, I'm comfortable with that.

    Does anyone have experience with this? Do I have to expose hooks to
    the app with COM or ActiveX or anything? (something I've used but
    haven't directly written before so it's possible). Am I crazy? Is
    there a better way to do this?

    I'd appreciate any advice or pointers, thanks ... N

    Nou Dadoun
  • McKirahan

    #2
    Re: Using HTML as an application GUI or How do you control an application from Javascript?

    "Nou Dadoun" <dadoun@cs.ubc. ca> wrote in message
    news:ae98a1f5.0 409211522.3f14b b88@posting.goo gle.com...[color=blue]
    > I'm currently developing an application in C++/MFC (Visual Studio 6,
    > if that makes a difference) and I'd like to avoid the Windows style UI
    > widgets and dialogs if at all possible.
    >
    > In fact, what I'd really like to do is use HTML/web pages as the user
    > interface and invoke my application in the background to do the heavy
    > lifting. I'm fairly well experienced with web pages and I've written
    > a fair amount of JavaScript at one time or another (I taught several
    > undergrad courses using it actually) but I don't know anything about
    > its capabilities when it comes to interfacing with or controlling
    > external applications.
    >
    > I'll likely be running IE on a Windows box (you can put it into full
    > screen no-toolbar mode) and here's the question: Can I use client-side
    > javascript to invoke and/or control my application? I know that
    > normally javascript can't play outside its own sandbox (i.e. no
    > filesystem access etc.) for security reasons, but I've seen in the MS
    > JScript documentation that it's possible to use something called
    > 'unsafe' mode. And since it will only be using web pages on the local
    > file system, I'm comfortable with that.
    >
    > Does anyone have experience with this? Do I have to expose hooks to
    > the app with COM or ActiveX or anything? (something I've used but
    > haven't directly written before so it's possible). Am I crazy? Is
    > there a better way to do this?
    >
    > I'd appreciate any advice or pointers, thanks ... N
    >
    > Nou Dadoun[/color]

    Look into HTA (HTML Applications)!

    http://msdn.microsoft.com/library/de...thor/hta/overv
    iew/htaoverview.asp

    Can you be more specific about your application?



    Comment

    • Robert

      #3
      Re: Using HTML as an application GUI or How do you control an application from Javascript?

      In article <ae98a1f5.04092 11522.3f14bb88@ posting.google. com>,
      dadoun@cs.ubc.c a (Nou Dadoun) wrote:
      [color=blue]
      > In fact, what I'd really like to do is use HTML/web pages as the user
      > interface and invoke my application in the background to do the heavy
      > lifting. I'm fairly well experienced with web pages and I've written
      > a fair amount of JavaScript at one time or another (I taught several
      > undergrad courses using it actually) but I don't know anything about
      > its capabilities when it comes to interfacing with or controlling
      > external applications.[/color]

      So, run apache on you PC. This would mean you could use all your
      existing skills developing your application.

      The other approach would be to write an HTA application. See:
      http://msdn.microsoft.com/workshop/a...taoverview.asp

      Robert

      Comment

      • Jim Ley

        #4
        Re: Using HTML as an application GUI or How do you control an application from Javascript?

        On 21 Sep 2004 16:22:42 -0700, dadoun@cs.ubc.c a (Nou Dadoun) wrote:
        [color=blue]
        >I'll likely be running IE on a Windows box (you can put it into full
        >screen no-toolbar mode) and here's the question: Can I use client-side
        >javascript to invoke and/or control my application?
        >
        >Does anyone have experience with this? Do I have to expose hooks to
        >the app with COM or ActiveX or anything? (something I've used but
        >haven't directly written before so it's possible). Am I crazy? Is
        >there a better way to do this?[/color]

        Yeah, it's easy and common, HTA's have been mentioned, personally I
        like Zeepe from http://www.meadroid.com/ for doing this, you get a
        lot more than HTA's give you in a nicer package.

        Jim.

        Comment

        • Nou Dadoun

          #5
          Re: Using HTML as an application GUI or How do you control an application from Javascript?

          "McKirahan" <News@McKirahan .com> wrote in message news:<cn54d.109 0$He1.78@attbi_ s01>...[color=blue]
          > "Nou Dadoun" <dadoun@cs.ubc. ca> wrote in message
          > news:ae98a1f5.0 409211522.3f14b b88@posting.goo gle.com...[color=green]
          > > I'm currently developing an application in C++/MFC (Visual Studio 6,
          > > if that makes a difference) and I'd like to avoid the Windows style UI
          > > widgets and dialogs if at all possible.
          > >
          > > In fact, what I'd really like to do is use HTML/web pages as the user
          > > interface and invoke my application in the background to do the heavy
          > > lifting. I'm fairly well experienced with web pages and I've written
          > > a fair amount of JavaScript at one time or another (I taught several
          > > undergrad courses using it actually) but I don't know anything about
          > > its capabilities when it comes to interfacing with or controlling
          > > external applications.
          > >
          > > I'll likely be running IE on a Windows box (you can put it into full
          > > screen no-toolbar mode) and here's the question: Can I use client-side
          > > javascript to invoke and/or control my application? I know that
          > > normally javascript can't play outside its own sandbox (i.e. no
          > > filesystem access etc.) for security reasons, but I've seen in the MS
          > > JScript documentation that it's possible to use something called
          > > 'unsafe' mode. And since it will only be using web pages on the local
          > > file system, I'm comfortable with that.
          > >
          > > Does anyone have experience with this? Do I have to expose hooks to
          > > the app with COM or ActiveX or anything? (something I've used but
          > > haven't directly written before so it's possible). Am I crazy? Is
          > > there a better way to do this?
          > >
          > > I'd appreciate any advice or pointers, thanks ... N
          > >
          > > Nou Dadoun[/color]
          >
          > Look into HTA (HTML Applications)!
          >
          > http://msdn.microsoft.com/library/de...thor/hta/overv
          > iew/htaoverview.asp
          >
          > Can you be more specific about your application?[/color]


          Thanks for the pointers to HTA (to Robert as well), that's a
          technology that I'd never tripped over before. Rename a web page and
          get an application, who'd a thunk it?

          A few questions though, it looks like a good prototyping tool for
          doing quick and dirty UI mockups but I don't see immediately (I'm
          still looking, of course) how it might be used as a real application
          interface for an existing application. i.e. is there any 'exposed'
          object model (that is, exposed to external apps)? Is there a file i/o
          mechanism, I'm not familiar with one in client-side javascript and I
          don't see an immediate connection to server-side js (which I've never
          used admittedly)? Are there other hooks or pointers that aren't
          immediately obvious? Does anyone have any actual experience using
          HTAs? Caveats? Mudholes?

          I can't go into a lot of detail about my app but it's actually two
          entirely separate applications, an image acquisition app which
          controls some USB cameras and writes images to disc and an image
          analysis app which does some processing and reporting on the saved
          images. The two currently communicate using the image files and a DDE
          mechanism (based on legacy code in the analysis app) to trigger the
          analysis but are otherwise entirely separate.

          Part of my goal in having an html front end is to use it to do some of
          the integration, i.e. ditch the DDE, have the front end trigger the
          acquisition/storage and subsequently the analysis under user control.
          But if retaining the DDE is simpler for a quick implementation, that's
          ok too (for the time being).

          Thanks again for any pointers ... N

          PS. Running an Apache server on a windows box for an app UI running
          on the same machine seems like a lot of overhead (there are some
          performance issues with the applications already) but if there's a
          serious case to be made for going that route (cgi? server-side js?)
          for a working prototype, I'm certainly open to hearing it, thanks ...
          N

          Comment

          • McKirahan

            #6
            Re: Using HTML as an application GUI or How do you control an application from Javascript?

            "Nou Dadoun" <dadoun@cs.ubc. ca> wrote in message
            news:ae98a1f5.0 409221342.5308c 77e@posting.goo gle.com...

            [snip]
            [color=blue]
            > A few questions though, it looks like a good prototyping tool for
            > doing quick and dirty UI mockups but I don't see immediately (I'm
            > still looking, of course) how it might be used as a real application
            > interface for an existing application. i.e. is there any 'exposed'
            > object model (that is, exposed to external apps)? Is there a file i/o
            > mechanism, I'm not familiar with one in client-side javascript and I
            > don't see an immediate connection to server-side js (which I've never
            > used admittedly)? Are there other hooks or pointers that aren't
            > immediately obvious? Does anyone have any actual experience using
            > HTAs? Caveats? Mudholes?
            >
            > I can't go into a lot of detail about my app but it's actually two
            > entirely separate applications, an image acquisition app which
            > controls some USB cameras and writes images to disc and an image
            > analysis app which does some processing and reporting on the saved
            > images. The two currently communicate using the image files and a DDE
            > mechanism (based on legacy code in the analysis app) to trigger the
            > analysis but are otherwise entirely separate.
            >
            > Part of my goal in having an html front end is to use it to do some of
            > the integration, i.e. ditch the DDE, have the front end trigger the
            > acquisition/storage and subsequently the analysis under user control.
            > But if retaining the DDE is simpler for a quick implementation, that's
            > ok too (for the time being).
            >
            > Thanks again for any pointers ... N[/color]

            [snip]

            I use HTAs to read files and databases, execute commands (like FTP), and
            much more.

            I primarily use VBScript to write them.

            Take a look at http://www.interclasse.com/scripts/htanotepad.php

            A notepad made in HTA

            This notepad can handle bigger files than the one shiped with Win9x.
            Learn how to make windows looking interfaces in HTML.

            A Google search on "HTML Application" will get you started.


            Comment

            • Robert

              #7
              Re: Using HTML as an application GUI or How do you control an application from Javascript?

              In article <ae98a1f5.04092 21342.5308c77e@ posting.google. com>,
              dadoun@cs.ubc.c a (Nou Dadoun) wrote:
              [color=blue]
              > PS. Running an Apache server on a windows box for an app UI running
              > on the same machine seems like a lot of overhead (there are some
              > performance issues with the applications already) but if there's a
              > serious case to be made for going that route (cgi? server-side js?)
              > for a working prototype,[/color]

              This would be best for port an existing PC application.
              [color=blue]
              > I'm certainly open to hearing it, thanks ...
              > N[/color]

              I'd only use apache if you were already familiar with apache
              programming. You would need to know how to run your backend code on
              Apache. Your code would need to be in the client server model.

              You would have to ask about performance over in an Apache web group.
              See:
              apache.org

              I cannot get enough traffic on my one machine. I could not get Apache
              above 1%.

              Robert

              Comment

              Working...