Results 1 to 2 of 2

Thread: How to save an OLE server's handle persistently?

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2009
    Posts
    3

    How to save an OLE server's handle persistently?

    I am attempting to make a visual automation server (OLE) persistent in the non-persistent wold of browsers. I can successfully launch the server from IE6 using VBScript as follows:

    # Code:
    1. Dim mySrvObj
    2. if not isobject(mySrvObj) then
    3.     Set mySrvObj = CreateObject("ImageDisplay.ImageDisplayInterface")
    4. end if

    Since browsers are not persistent, every time the browser refreshes, I lose the handle to the server. This causes the server to shut down and start up with each page refresh/submit.

    I was able to accomplish this using a frame and two frame sets. The first frameset contains content. The second frameset is hidden and is also persistent. It contains the server's handle MasterSrvObj. I can refresh the handle in the content frameset from the hidden frameset as follows:

    mySrvObj = parent.hidden.MasterSrvObj

    This works beautifully, however, using framesets is not a very good solution.

    I tried a variation of the frameset solution using two browsers. The first browser launches the application. It also launches a second browser. The second browser only function is to launch the server and store the handle (MasterSrvObj). I was hoping I could reference MasterSrvObj from the frist browser.

    I've also tried the following unsuccessfully:

    1. Saving the handle as a cookie.

    2. Assigning the handle to a hidden text field on browser 2 to browser 1 as follows (browser 1 launched browser2):
    document.self.getElementByID(srvObj).value=document.subWindow.getElementByID(MasterSrvObj).value;
    This code is browser 1.

    3. Tried using the the opener fuction:

    window.opener.formname.textfieldname.value = MasterSrvObj in the second browser.

    Question 1 Is there a way to get the server's handle using any Microsoft script, such as window.opener.returnValue = MasterSrvObj; 2008, C#, JSCript, JavaSCript, or WScript? Please speak up loudly it you have a solution!!!

    Question 2: If I were to launch the server first and then launch the browser second, is there a way I can get the handle of the server from the browser? That way I am not dependent on the non-persistent browser. If so, how can I do this?

    Question 3: The variable mySrvObj is VarType(mySrvObj)=9. Is there a way I can can convert the handle into a numeric or string data type and save it as a cookie?

    Please help. I am quickly running out of ideas and desperate!

    Thanks much for taking the time to read all of this. I hope my explanation was somewhat coherent!

    Thanks again.

    Cheers!

  2. #2

    Thread Starter
    New Member
    Join Date
    Dec 2009
    Posts
    3

    Re: How to save an OLE server's handle persistently?

    Here is a screen shot of the application on the right. The server on the left. Notice in the upper right corner a small IE6. This the two browser attempt.

    Click thumbnail to see image.


    Last edited by rcflyer2005; Dec 10th, 2009 at 12:57 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width