An appropriate moment.

Hi,

One of my applications is hosting internet explorer to display pages which are using dedicated scripting interfaces. Theese interfaces are pushed to 'document's via IDispatchEx. (GetDispID with fdexNameEnsure than Invoke). It is working 'almost' perfectly except thoose interfaces are become available after the scripts are initialized.

<html>
<head>
<script language="javascript">
alert(providedString);
</script>
</head>
<body>
<input id="Kick Me!" type="button" value="button" onClick="alert(providedString);"/>
</body>
</html>

First call to alert will fail while second works. This is because providedString will be available when DISPID_NAVIGAGECOMPLETE2 is fired by MSHTML.

Is there any event/method fired/called after the document is completed and BEFORE the scripts are initalized?
My browser class uses following interfaces as bases.
IServiceProvider
IInternetSecurityManager
IOleClientSite
IOleInPlaceSite
IDocHostUIHandler
DWebBrowserEvents2

Ps: I'm not using external

[1175 byte] By [TurgutHakk??ZDEM?] at [2007-12-27]
# 1

First let me tell you I'm no expert on this.

The solution I would come up with is to have all code triggered only on or after body.onLoad. You could have a bool stating if the page is completely loaded. Not shure if this applies though.

JonathanvandeVeen at 2007-9-3 > top of Msdn Tech,Architecture,Architecture General...