Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delphi Automation Server

16 views
Skip to first unread message

rcflyer2005

unread,
Aug 4, 2008, 11:06:08 PM8/4/08
to marvi...@aol.com
I have written a Delphi 7, out-of--process (.exe), visual, apartment
threaded server to used by client (host) application in support of
document imaging.

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


Robert Jordan

unread,
Aug 15, 2008, 4:06:58 PM8/15/08
to
rcflyer2005 wrote:
> Question: How to make the server persistent in the state less world of
> html?

>

> 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

0 new messages