Back to product page

Notification property


Fast notification interface to use instead of events.

Type

IwodTelnetNotify object

Syntax

  • Basic
[Set] object.Notification [= value]
The Notification(object,value) syntax has these parts:
objectAn expression evaluating to an object of type wodTelnetDLX
valueIwodTelnetNotify object

Remarks

This property is only available in COM version of the component.

Notification property holds reference to IwodTelnetNotify interface that can be implemented by your application. When this property is set, and contains such a reference, wodTelnetDLX will call your method implementations instead of firing events. More information on how this works can be found here.

For example, instead of having this in your code (VB example):
 
Private Sub Telnet1_Connected(ByVal ErrorCode As Long, ByVal ErrorText As String)
 
End Sub
 

you will have this:
 
Private Sub IwodTelnetNotify_Connected(ByVal Owner As wodTelnetDLXComLib.IwodTelnetDLXCom, ByVal ErrorCode As Long, ByVal ErrorText As String)
 
End Sub
 

pretty much the same - except notification method has one more argument - Owner, which holds reference to wodTelnetDLX instance that called this method.

In VB, to implement IwodTelnetNotify interface, you need code like this:
- at the top of the code, in section, put this:
 
   Dim Telnet As wodTelnetDLXCom
   Implements IwodTelnetNotify
 

- in Form_Load (or where you initialize new instance of wodTelnetDLX) do this:
 
   Set Telnet = New wodTelnetDLXCom
   Set Telnet.Notification = Me
   Telnet.Protocol = Telnet
   Telnet.Timeout = 30
   Telnet.Connect
   '...

You can notice that when we declared Telnet, we did not use WithEvents keyword - it is not needed anymore, because events will not be fired anymore. Notification methods we implement will be called instead!

Platforms

Windows