Problem: Each time the web page is refreshed or a different web page
is display, the server closed down and then redisplays because the
reference to myServObject (see below) id destroyed and then recreated.
Question: How to make the server persistent in the state less world of
html?
Thanks much!!!
Possible Solutions:
1.Make the Server Thread Model=Free
2. Use html:
<HEAD>
<FRAMESET rows="100%,*">
<FRAME name="MAIN" src="mainpage.html" />
<FRAME name="HIDDEN" src="hiddenControlPage.html" id="hide"
style="display:none; visibility:hidden;"/>
</FRAMESET>
</HEAD>
src="hiddenControlPage.html" contains the following:
<SCRIPT Language="VBScript">
if not isobject(mySrvObj) then
Set mySrvObj = CreateObject("ImageDisplay.ImageDisplayInterface")
end if
</SCRIPT>
in hope the hidden frame would be persistent between the visible
portions of the web page.
Access the hidden page as:
Set MySrvObj = parent.hide.mySrvObj --> this would get me the "handle"
of the server when the MAIN web page changes or is refreshed.
Background:
The URL below shows a screen shot of:
1. The client host application, such as an Accounts Payable (AP)
system, on left.
2. The Delphi automation server. on right.
http://rapidshare.com/files/134909372/AP-Image_Display_Example2.JPG
After the user, clicks Work Invoice in IE6, the next available invoice
image for the company (02) and invoice type (P=purchase order) is
displayed in the automation server. Note in IE6 the Document Number
for the invoice has been returned to IE6.
The page shown in IE 6 is not real AP system. It is a web page to
test method calls to the server.
I am using VBScript to communicate between the web page and the
server.
For example, the vbs executed:
1. To instantiate the Delphi server.
if not isobject(mySrvObj) then
Set mySrvObj = CreateObject("ImageDisplay.ImageDisplayInterface")
end if
I want to maintain the mySerObject for ever, or at lease until I close
the web page.!!!
2. To execute the Work Invoice method:
mySrvObj.WorkInvoice(vCompany, vInvType, vDocID, vStaus) where
vCompany='02', send value
vInvType='P', send value
vDocID='0000000525' return value
vStatus= "S" or "F" for Success or Failure, return value
>
> src="hiddenControlPage.html" contains the following:
> <SCRIPT Language="VBScript">
> if not isobject(mySrvObj) then
> Set mySrvObj = CreateObject("ImageDisplay.ImageDisplayInterface")
> end if
> </SCRIPT>
Use GetObject instead of CreateObject. Something like this (I'm not
a VB guy):
Set mySrvObj = GetObject("", "ImageDisplay.ImageDisplayInterface")
Robert