Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running an app using HTML and VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00674472
Message ID:
00674568
Vues:
13
>I'm creating an application manager for the office. The idea is that the foxpro application will read a table and then create and display an HTML page. The HTML page will have links relating to applications the user has access to, and can run them by clicking on the links (the manager will also run updates automatically, and other maintenance things in the background).
>
>The problem is that if you simply point the link to an application file using an "a href" tag, when you click on the link a window pops up to inform you that you are trying to download a file to your hard drive (from your hard drive, no less) and would you like to open, save, cancel, or get more information. Is there any way, using HTML and/or FoxPro, to click on a link and run an application without getting this message?
>
>Robert

Not directly. Garrett's suggestion is the only way to handle this. Basically, you put code in the BeforeNavigate2() event of the IE control. Then you parse out the original string, and call the app from within your VFP code:
FUNCTION BeforeNavigate2()
LPARAMETERS pdisp, url, flags, targetframename, postdata, headers, cancel
LOCAL lnAT, ;
      lcText

* Code to parse out original URL string goes here
* IE automatically tacks on some extra garbage 
* that you'll need to remove. This is untested
* code and probably won't work. It's just a sample 
* of what you might do.

lnAt = atc("HTTP://", upper(url))
   
lcText = upper(alltrim(substr(url, lnAt + 6)))

DO CASE
   CASE lcText = "Some HTTP call goes here"
        RUN SomeApp.EXE
   OTHERWISE
        * I didn't recognize the URL, don't do anything
ENDCASE

* Cancel the original navigation
cancel = .T.

ENDFUNC
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform