'onafterprint' is ambiguous across the inherited interfaces 'mshtml.DispHTMLWindow2' and 'mshtml.HTMLWindowEvents_Event'

'onafterprint' is ambiguous across the inherited interfaces 'mshtml.DispHTMLWindow2' and 'mshtml.HTMLWindowEvents_Event'

Post by Christia » Sun, 08 Jun 2003 20:02:33



How do I get this event handler working? The error "'onafterprint' is
ambiguous across the inherited interfaces 'mshtml.DispHTMLWindow2' and
'mshtml.HTMLWindowEvents_Event'."
is because of the event handler declaration "Private Sub win_onafterprint()
Handles win.onafterprint"

Thanks for any clues about this. Where can I find more insights on how to
tranlate this to C++ managed extensions?

C

Dim WithEvents win As mshtml.HTMLWindow2

Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs
As System.EventArgs) Handles MyBase.Load

WebBrowser1.Navigate("http://www.microsoft.com")

End Sub

Private Sub WebBrowser1_DocumentComplete(ByVal eventSender As System.Object,
ByVal eventArgs As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent)
Handles WebBrowser1.DocumentComplete

'UPGRADE_ISSUE: VBControlExtender property WebBrowser1.object was not
upgraded. Click for more:
'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup2064"'

If eventArgs.pDisp Is WebBrowser1 Then

'UPGRADE_WARNING: Couldn't resolve default property of object
pDisp.Document. Click for more:
'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"'

win = eventArgs.pDisp.Document.parentWindow

WebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT,
SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, Nothing, Nothing)

End If

End Sub

Private Sub win_onafterprint() Handles win.onafterprint

MsgBox("Done printing!")

End Sub