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

Discussion in 'Javascript' started by Nou Dadoun, Sep 22, 2004.

  1. Nou Dadoun

    Nou Dadoun Guest

    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
     
    Nou Dadoun, Sep 22, 2004
    #1
    1. Advertising

  2. Nou Dadoun

    McKirahan Guest

    "Nou Dadoun" <> wrote in message
    news:...
    > 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


    Look into HTA (HTML Applications)!

    http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overv
    iew/htaoverview.asp

    Can you be more specific about your application?
     
    McKirahan, Sep 22, 2004
    #2
    1. Advertising

  3. Nou Dadoun

    Jim Ley Guest

    On 21 Sep 2004 16:22:42 -0700, (Nou Dadoun) wrote:

    >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?


    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.
     
    Jim Ley, Sep 22, 2004
    #3
  4. Nou Dadoun

    Nou Dadoun Guest

    "McKirahan" <> wrote in message news:<cn54d.1090$He1.78@attbi_s01>...
    > "Nou Dadoun" <> wrote in message
    > news:...
    > > 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

    >
    > Look into HTA (HTML Applications)!
    >
    > http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overv
    > iew/htaoverview.asp
    >
    > Can you be more specific about your application?



    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
     
    Nou Dadoun, Sep 22, 2004
    #4
  5. Nou Dadoun

    McKirahan Guest

    "Nou Dadoun" <> wrote in message
    news:...

    [snip]

    > 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


    [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.
     
    McKirahan, Sep 22, 2004
    #5
    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. Doris Cox
    Replies:
    0
    Views:
    562
    Doris Cox
    Dec 2, 2003
  2. Dennis
    Replies:
    0
    Views:
    706
    Dennis
    Dec 2, 2003
  3. Matthew Louden
    Replies:
    1
    Views:
    7,105
    Scott M.
    Oct 11, 2003
  4. Dennis
    Replies:
    0
    Views:
    463
    Dennis
    Dec 2, 2003
  5. pek
    Replies:
    0
    Views:
    1,238
Loading...

Share This Page