I'm obsessed in interfacing a web application to an ole server written in Delphi 2007! The the direction of the flow works as follows:
HTML Page --> VBScript --> Delphi OLE Server --> VBScript --> HTML Page. Starting at the HTML page works perfect. I can execute methods on the server and get data back.
There are programs on the internet which if you enter a program name, it will return the handle to that program, provided it is running. See picture below as an example.
My question is way Out-Of-The-Box. If I have a Program Name and Handle, can I "somehow stuff" the Handle, Program Pame and DispInterface Name in a VBScript Object and have the VBS Object and have the VBS object work as if it were created this way:
Create the object in VBS --> Set mySrvObj = CreateObject("ImageDisplaySrv.ImgDisp")
Call a server method from VBS --> mySrvObj.WorkInvoice(vCompany, vInvType, vDocID, vStaus)
Would other scripting languages, such as PHP, Python, etc... that could do this?
What I want to do is something like this:
Dim myObject
myObject = handle of the object, Disp Interface Name, GUID, program name, whatever is needed. I want this for my ole Server
If you know of a resource, please point me in that direction.
Thanks.
I know, I don't want toooo much!
LOL
Unfortunately, I'm serious.
The problem is when a web page refreshes, I loose the BVS handle to the ole server. Consequently the server terminates and is relaunched with every time the web page is refreshed. In a high volume Accounts Payment invoice input process the server would he launching and closing down with each new invoice. Whenever the web page refreshes, I have to recreate the ole server using vbs as follows: Set mySrvObj = CreateObject("ImageDisplaySrv.ImgDisp"). I think that would be extremely irritating for the AP clerk. I would prefer a persistent server between web pages.
I am attempting to find a way the server can be:
1. Launched independently of the host application (web page), and most importantly,
2. I am trying to find web technology that can establish and reestablish communication with a persistent ole server given thatweb technology is mostly stateless.
It's not going to be possible using web technology to do this client-side. By definition, as you note, the web is stateless and cannot maintain connections through new pages.
Properly speaking, the host application is IIS (or apache), a web page is just a product of the web server.
you should be able to keep a process running in IIS. You need to write it to run as a service rather than as a called application.
(e.g. ISAPI and FastCGI are both things that IIS keeps running).
I am able to maintain state of the server by using a frameset and two frames. One frame is my web page. The second frame, which is hidden, holds the handle to the server. Please see link below.
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
I believe what you are describing sounds like COM (component object model)
you can do that in PHP. I don't think you can use PHP as a COM object in other languages and I severely doubt you can do that with Python.
What exactly is your question?