Workaround detected:
I had to implement an additional DWebBrowserEvents2interface , as described in this code draft article , in order to get additional events.
BeforeNavigate2 .
, pDisp IWebBrowser2 interface Parent NULL NULL (I) FRAMES.
, :
public class BrowserExtendedNavigatingEventArgs : CancelEventArgs
{
public bool IsInsideFrame
{
get
{
var wb = AutomationObject as UnsafeNativeMethods.IWebBrowser2;
return wb != null && wb.Parent != null;
}
}
}
, , IsInsideFrame , -, , :
"... IE COM, -, Single . , , , . , GIT CoMarshallInterThreadInterfaceInStream() ..."
, .
AccessViolationException s wb.Parent, , , .
.
. , -.
:
public void BeforeNavigate2(
object pDisp,
ref object url,
ref object flags,
ref object targetFrameName,
ref object postData,
ref object headers,
ref bool cancel)
{
var isTopFrame = _browser._axIWebBrowser2.Equals(pDisp);
}
, , .