-
-
Basic information
As you might have read elsewhere, wodXMPPCom can use a fast
notification interface instead of firing events. This means
that each time wodXMPP would normally fire an event, it
will call your implementation of the event instead.
Notifications can be 30 times faster than events - meaning
it is advisable to use them if performance is a requirement
of your applications.
wodXMPP ActiveX DOES NOT support notifications - only
the wodXMPPCom component does!
You must declare ALL notification methods if you want to
implement IwodXMPPNotify, no
matter whether you need them or not. For example, many
users don't need the
ChatRoomListDone
event, but at least the empty body for this event MUST
exist when notifications are used.
You can read below the steps that are required to implement
your own IwodXMPPNotify interface. As an example, we will
put it on the main form. You can also put it into a
separate VB class, in which case instead of the
'Me' keyword, you will use
name of the class.
Steps needed to implement IwodXMPPNotify
1. Add a Reference to the wodXMPPCom COM Object to your
application
2. Instead of declaring wodXMPP like this:
Dim WithEvents VPN1 as
wodXMPPCom
you should do this:
Dim VPN1 as wodXMPPCom
Implements IwodXMPPNotify
3. In Form_Load, create new instance for VPN1, and pass
reference of our IwodXMPPNotify to it
Set VPN1 = new wodXMPPCom
Set VPN1.Notification = Me
4. Implement ALL methods, or at least declare their empty
bodies. You can do it automatically if you locate the
'IwodXMPPNotify' object in the list of all objects
that exist on your form (combo box in upper left corner of
your code view), or just can do it by hand.
5. All done. Now put breakpoints into your methods. You
will see that instead of the event firing, your methods
will be called instead.
Method declarations
Private Sub IwodXMPPNotify_ChatRoomData(ByVal Owner
As WODXMPPCOMLib.IwodXMPPCom, ByVal Room As
WODXMPPCOMLib.IXMPPChatRoom)
End Sub
Private Sub IwodXMPPNotify_ChatRoomListDone(ByVal
Owner As WODXMPPCOMLib.IwodXMPPCom, ByVal Service As
WODXMPPCOMLib.IXMPPService)
End Sub
Private Sub IwodXMPPNotify_Connected(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom)
End Sub
Private Sub IwodXMPPNotify_ContactAuthRequest(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, Action As WODXMPPCOMLib.XMPPActionsEnum)
End Sub
Private Sub IwodXMPPNotify_ContactList(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom)
End Sub
Private Sub IwodXMPPNotify_ContactStatusChange(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, ByVal ChatRoom As
WODXMPPCOMLib.IXMPPChatRoom, ByVal NewStatus As
WODXMPPCOMLib.StatusEnum, ByVal OldStatus As
WODXMPPCOMLib.StatusEnum)
End Sub
Private Sub IwodXMPPNotify_ContactSearchDone(ByVal Owner
As WODXMPPCOMLib.IwodXMPPCom, ByVal Service As
WODXMPPCOMLib.IXMPPService, ByVal Items As WODXMPPCOMLib.IXMPPVars)
End Sub
Private Sub IwodXMPPNotify_Disconnected(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal ErrorCode As Long, ByVal ErrorText
As String)
End Sub
Private Sub IwodXMPPNotify_Error(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, ByVal ChatRoom As
WODXMPPCOMLib.IXMPPChatRoom, ByVal Service As
WODXMPPCOMLib.IXMPPService, ByVal ErrorCode As Long, ByVal ErrorText
As String)
End Sub
Private Sub IwodXMPPNotify_FileTransferEnd(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, ByVal File As WODXMPPCOMLib.IXMPPFile,
ByVal ErrorCode As Long, ByVal ErrorText As String)
End Sub
Private Sub IwodXMPPNotify_FileTransferProgress(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, ByVal File As WODXMPPCOMLib.IXMPPFile,
ByVal Position As Long)
End Sub
Private Sub IwodXMPPNotify_FileTransferStart(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, ByVal File As WODXMPPCOMLib.IXMPPFile,
Action As WODXMPPCOMLib.XMPPActionsEnum)
End Sub
Private Sub IwodXMPPNotify_HostCertificate(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Cert As WODXMPPCOMLib.ICertificate,
ByVal ErrorCode As Long, ByVal ErrorText As String, Action As
WODXMPPCOMLib.XMPPActionsEnum)
End Sub
Private Sub IwodXMPPNotify_IncomingMessage(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, ByVal ChatRoom As
WODXMPPCOMLib.IXMPPChatRoom, ByVal Message As
WODXMPPCOMLib.IXMPPMessage)
End Sub
Private Sub IwodXMPPNotify_IncomingNotification(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, ByVal NotifyID As
WODXMPPCOMLib.ContactNotifyEnum, ByVal Data As Variant)
End Sub
Private Sub IwodXMPPNotify_Pong(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, ByVal ErrorCode As Long, ByVal ErrorText
As String)
End Sub
Private Sub IwodXMPPNotify_PreTranslateCommand(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, Command As String)
End Sub
Private Sub IwodXMPPNotify_PreTranslateReply(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, Reply As String)
End Sub
Private Sub IwodXMPPNotify_PrivateData(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Name As String, ByVal Value As
String)
End Sub
Private Sub IwodXMPPNotify_ServiceRegister(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Service As
WODXMPPCOMLib.IXMPPService, ByVal Success As Boolean, ByVal
Instructions As String)
End Sub
Private Sub IwodXMPPNotify_ServiceStatusChange(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Service As
WODXMPPCOMLib.IXMPPService)
End Sub
Private Sub IwodXMPPNotify_StateChange(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal OldState As
WODXMPPCOMLib.StatesEnum)
End Sub
Private Sub IwodXMPPNotify_UnhandledIQ(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal JID As String, ByVal IqType As
WODXMPPCOMLib.IqTypes, ByVal ID As String, ByVal Tags As
WODXMPPCOMLib.IXMPPTag)
End Sub
Private Sub IwodXMPPNotify_VCardDetails(ByVal Owner As
WODXMPPCOMLib.IwodXMPPCom, ByVal Contact As
WODXMPPCOMLib.IXMPPContact, ByVal Partial As Boolean)
End Sub
|