Re: Maintaining State Between Web Pages



"crashRCFlyer" wrote:

I am not running the automation server inside a web browser. I call an
ActiveX object that runs within IE6 an "Active Form" in Delphi lingo.

Just a matter of implementation. Okay, it runs as an independent process,
instead of as a browser plugin. Simpler to do, of course. More flexible,
too; not limited to what the browser allows.

I 've uploaded two jpg images in a zip file to rapidshare.com.

Looked at the images. All makes sense. Not completely clear what the
browser brings to the table (that is, why not just communicate directly with
the remote servers), but I guess flexibility and interoperability aren't
terrible answers.

You Wrote:
"Seems to me the alternative to this would be to always store the data to
some known place, before the object is "torn down" by leaving one page and
then "built up" again on encountering another page. This wouldn't be hard.
You could just store to a temp file on the user's computer. And since you
control the format of the storing, you could use most anything you wanted
that would be efficient."

I have no idea how to do the above.

Well, that's still a possible option. Really wouldn't be that hard to do.
But it means that you'd *STILL* see the control disappear every time you
changed web pages. And I presume that's as big an annoyance as anything else.

So...

I admit I am *guessing* as to what causes your control to be "killed" when
the browser changes pages. I would *assume* that the link to the control
from within the web page says "I'm done with this object now" and then the
tearing down of that object ("mySrvObj") tells the automation object to close
itself. And by the nature of HTML pages and the objects they create, closing
the page (and, yes, that includes simply bringing up another version of the
SAME page) closes the object.

Thus the obvious solution is to *NOT* close the browser page that controls
the object. And you should be able to do that via (as I mentioned) browser
tabbed windows or <FRAME>s.

For example, suppose you had a <FRAMESET> that contained an invisible
<FRAME>, and if that invisible frame contained the VBS code that instantiated
the OLE object and thus launched the automation object. And then the
frameset *ALSO* contains a <FRAME> where the interactive web page is
displayed. The interactive frame's code can ask the hidden frame for a copy
of the reference to the object and then make the requested call on that
object. When the interactive frame moves to another web page (or even
re-loads the current one), the current copy of the object reference is lost.
But the hidden frame maintains the connection and the next page can ask for
it, again.

*** 100% UNTESTED AND PURELY A GUESS ***

Still, it makes sense. It should certainly be worth trying.

<FRAMESET rows="100%,*">
<FRAME name="MAIN" src="mainpage.html" />
<FRAME name="HIDDEN" src="hiddenControlPage.html" />
</FRAMESET>

And then, in the "hiddenControlPage.html", you do
<SCRIPT Language="VBScript">
Set MasterSrvObj = CreateObject(....)
</SCRIPT>

and in the "mainpage.html" and in all pages that come after, you code
something like this to get a copy of the object reference:

<SCRIPT Language="VBScript">
Set MySrvObj = parent.HIDDEN.MasterSrvObj
</SCRIPT>

and after that use MySrvObj just as you have been.

NOTE: Just be sure that none of your <FORM>s or <A> tags use
target="_top"
or equivalent. If you do that, then the reference page will be loaded at
the top level and will replace the <FRAMESET> and then the main object
reference will be forced to close.

This should be dirt simple to make a quick & dirty test to see if my
*guesses* are correct. Good luck.
.



Relevant Pages

  • Re: Maintaining State Between Web Pages
    ... not limited to what the browser allows. ... <FRAME>, and if that invisible frame contained the VBS code that instantiated ... the current copy of the object reference is lost. ... the server. ...
    (microsoft.public.scripting.vbscript)
  • Re: Maintaining State Between Web Pages
    ... not limited to what the browser allows. ... <FRAME>, and if that invisible frame contained the VBS code that instantiated ... the current copy of the object reference is lost. ... server for the duration of your browser session, if that is what you want. ...
    (microsoft.public.scripting.vbscript)
  • Re: How to run PPT inside a web page Frame?
    ... you want to be able to control the thing as well as ... that has the same effect as loading it as the frame source... ... I'm trying to figure a way to get the PPT inside the HTML of the ... Then depending on the browser settings and a few bits in the registry, ...
    (microsoft.public.powerpoint)
  • Re: VBA - Click mouse to change cursor to cross hair that spans th
    ... How do I control the scroll bar positions in WebBrowseer1 ... "NickHK" wrote: ... make sure the frame containing the browser is behind the 2 frames; ...
    (microsoft.public.excel.programming)
  • GetWindowRect on Embedded Dialog
    ... When I do a GetWindowRecton the tree control, ... "Left" values so I can resize the control in proportion to the frame on ... EMBEDDED dialog as the reference point. ...
    (microsoft.public.vc.mfc)

Loading