Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synergy of VFP-desktop into the web-base 2

Status
Not open for further replies.

ariswan2007

Programmer
Jul 26, 2019
9
ID
Dear Team,

We know that several applications today can be integrated and run on the web by inserting code/scripts in HTML files, such as : javascript, CSS, PHP, etc. Are there references to code/script VFP inserted in the HTML file ...? so that it can be run through the web. As an illustration, to make messages in the HTML web we usually use javascript (alerts or sweetalert), while on the VFP desktop we use code messagebox.

Web-HTML: <script type = "text / javascript"> alert ("Hello world"); </script>
Desktop-VFP: MESSAGEBOX("Hello world")

In the development of database management applications that are more dynamic and complex, in my opinion making a web-base application with a combination of : html+javascript+CSS+PHP is relatively more complex than desktop VFP applications.

If there is a synergy of VFP scripts that can be inserted and run in HTML files such as : javascript, CSS, PHP, of course this will greatly help VFP programmers to adapt to the development of IT technology today, without having to migrate and learn more new applications on the web-base version, which of course requires extra time, thought and energy.

thank you
 
You may want to look at this


It allows you to have a web-version and a desktop version at the same time.


If you want to get the best response to a question, please check out FAQ184-2483 first.
 
It's an old hat - or several. There are even parts of the VFPinstallation itself dedicated to that topic.

There is foxisapi.dll, with which you can integrate executing VFP code from ISAPI capable web servers, which includes IIS and Apache and VFP Samples also include FoxWeb, a whole Webserver written in VFP.
All this is quite outdated but still works. Hosting based on this is lacking hosters, that'd allow adding that foxisapi.dll, but in a Microsoft based VM hosting you could use that. You can of course also use it locally, see Home()+"Samples/Servers".

People have done other things based on that and from scratch. For example Rick Strahl. While he has left VFP to join the .NET community his VFP/Web integration efforts are also very complete and still up to date. West Winds Web connect doesn't just help to bring the web into VFP applications but also is the foundation for building web applications with VFP.

Just a list of things: VFP2IIS, AFP(X), ActiveVFP.

As you are much more concerned about running VFP code than integrating into PHP or JS code, it'll perhaps interest you less, but VFP within JS is possible via OLE/COM on Windows, which excludes users on other OSes and of course, also requires installing your VFP COM DLLs.

And PHP hosted on Windows is capable to use an COM this way:

Code:
<?php
// starting word
$word = new COM("word.application") or die("Unable to instantiate Word");
echo "Loaded Word, version {$word->Version}\n";

//bring it to front
$word->Visible = 1;

//open an empty document
$word->Documents->Add();

//do some weird stuff
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("Useless test.doc");

//closing word
$word->Quit();

//free the object
$word = null;
?>

Notice: COM() only is part of PHP on Windows, so requires Windows Hosting. Also, this is using Word automation silently, you'll never be able to let clients use Word via their browser here, but can automate the creation of Doc files, and being capable to run word.application more general means to be able to run visualfoxpro.application when VFP is installed on the server as one possibility and, of course, creating COM Servers you write yourself as DLL or EXE and install on the server, too. It's much more feasible that way than installing the COM Servers at clients and use them there via JS, but for sake of completeness, in JS you can use a COM Server via:
Code:
var oleObject = new ActiveXObject('comserver.name')

It's just very limited not only to Windows but also to the InternetExplorer Browser, and within that also requires to either allow ActiveX in general or have your OLE classes in the trusted zone. Therefore the serverside is a much easier route, as you can choose that and have that under your control.

The major recommendation goes to West Winds Web connect, regarding these things.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Ariswan said:
in my opinion making a web-base application with a combination of : html+javascript+CSS+PHP is relatively more complex than desktop VFP applications.

It's more complex to provide users the same interactive GUI: on each user action, refresh just the parts of the form that need to change, not the full page like you typically see on a web site when clicking an hyperlink. To provide an interactive experience, you need AJAX and a lot of JavaScript, tied with HTML and CSS. The sum of these 3 technologies, plus the server side (being able to update some items on the page depending on user's specific context) makes it complex altogether. Today web developments generally require a stack of competences (HTML/CSS, JS, server-side) and 'full-stack' developers become more rare.

FoxInCloud generates a full AJAX web application from your VFP application: the web app behaves the same as your desktop app through generated HTML, CSS and JS. Server-side runs your app's code provided you've adapted it to run on either the web or the desktop (using the free FoxInCloud Adaptation Assistant).

The FoxInCloud Live Tutorial ( lets you see the generated code (HTML/CSS/JS) and the server-side VFP code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top