Problem with MSXML3 SAX ErrorHandler implementation

Choli
Choli used Ask the Experts™
on
Hi

Another newbie question. I have written a VB Class Module which implements the interfaces IVBSAXContentHandler and IVBSAXErrorHandler.

With the content handler, there is no problem but Visual Basic wont accept the implementation of my error handler method. The error message says that the signature of my errohandler method is not compatible with the interface, even tough it looks exactly like the one in the SDK.

<snip>
Implements IVBSAXErrorHandler

Private Sub IVBSAXErrorHandler_Error(ByVal oLocator As
IVBSAXLocator, ByVal strError As String, ByVal nErrorCode
As Long)
    MsgBox "error"
End Sub

Private Sub IVBSAXErrorHandler_fatalError(ByVal oLocator
As IVBSAXLocator, ByVal strError As String, ByVal
nErrorCode As Long)
    MsgBox "fatalError"
End Sub

Private Sub IVBSAXErrorHandler_ignorableWarning(ByVal
oLocator As IVBSAXLocator, strErrorMessage As String,
ByVal nErrorCode As Long)
    MsgBox "ignorableWarning"
End Sub
</snip>

Some Idea?

Thanx

Choli
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try removing ByVal from the second parameter which should be a reference parameter:

e.g.
Private Sub IVBSAXErrorHandler_Error(ByVal oLocator As
IVBSAXLocator, ByRef strError As String, ByVal nErrorCode
As Long)


>S'Plug<

Author

Commented:
Altough the Documentations says ByVal... ;-) (And somewhere else says that strings are allways by Ref...)

Got it? I ditn't...

Thanx and Cheers

Choli

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial