NLog properties, events, and methods are set via the NLogViewerCtl 1.0 Library. Read about NLog Enumerations.
Read-only. Returns the name of the application (specified by the index parameter) running on the machine. Combined with the AppCount property, you can iterate through the list of applications running on the machine.
Dim cnt As Integer
Dim x As Integer
cnt =
NLogViewer1.AppCount
For x = 0 To cnt - 1
Debug.Print
NLogViewer1.app(x)
Next x
Read-only. Returns the number of VBVoice applications running on the machine. Combined with App(index) property, you can iterate through the list of applications running on the machine. See App property.
Read-only. Returns the full application name for the index-th application running on the machine. The full name consists of three values separated by semi-colons:
EXAMPLE
vb6.exe;2315;slave1
Where:
vb6.exe = executable name
2315 = process ID
slave 1 = slave name (empty unless the application is a slave)
Returns the current channel range build string. All the channels added using BuildString_AddChannel are fused into ranges of contiguous channels, such as 0-23;31-37.
Read-only. Returns the number of lines or line count on the machine. Note that this value may change if the system stops, starts, or adds and removes channels.
Dim MaxChannels as Integer
MaxChannels = NLogViewer1.LineCount
Read-only and zero based. Returns the name and type of the specified indexed parameter, such as Dialogic Analog B1C1.
Dim MaxChannels as Integer
MaxChannels = NLogViewer1.LineCount
For x = 0 To MaxChannels - 1
Debug.Print
NLogViewer1.linename(x)
Next x
SubscriptionAppName is the name of the application to subscribe to. Set SubscriptionAppName, SubscriptionRangeString, then call the UpdateSubscription method.
NLogViewer1.SubscriptionAppName = "EZLOW.EXE:2322"
NLogViewer1.SubscriptionRangeString = "0-23"
NLogViewer1.UpdateSubscription
Returns or sets the current subscription range string, such as 0-7;23-31. The range string defines a set of channels whose log messages are to be received. SubscriptionRangeString is used in conjunction with UpdateSubscription to change the current subscription.
Resets the string builder for channel ranges to empty string. Use this method to create a new channel range string that can be passed to SubcriptionRangeString.
Example:
NLogViewer1.BeginBuildString
For i = 0 to UBound(myChannelArray)
'array of booleans indicating which channels
we want to monitor
if myChannelArray(i) then
NLogViewer1.BuildString_AddChannel(i)
Next i
NLogViewer1.SubscriptionRangeString = NLogViewer1.BuildString
NLogViewer1.UpdateSubscription
Adds a channel to the channel range build string. See BeginBuildString above for more information.
Tries to connect to the NLogServer running on the specified machine name and start receiving log information. Use localhost to logon to your local machine or pass the name of the machine, such as Server. Connect must be called first. After the Connect method is called, set and get properties, methods, and events.
NLogViewer1.Connect "localhost"
Asks the NLogServer for log information. DoTick should be called regularly in a timer because all events are fired during DoTick.
Private Sub Timer1_Timer()
'one second
timer
NLogViewer1.DoTick
End
Sub
Stops the internal processing of the NLogViewerControl. Must be called during Form_Unload.
Applies the SubscriptionAppName, SubscriptionMaxChannel, and SubscriptionMinChannel properties. See SubscriptionAppName.
The AppState event is fired after the ConnectionState event and returns the state (whether the application is running) of the appName application. State parameter = 1 means the application is currently running and state = 0 means the application is not running.
Note that the Connect and DoTick methods must be called for the AppState event to be fired.
appName: String value that is the name of application, such as Ezflow:2322.
state: Integer value of 0 or 1. A value of 1 means the appName is currently running and 0 means the appName is currently not running.
Private Sub NLogViewer1_AppState(ByVal appName As String, ByVal state As Integer)
If state = 0 ThenThe ChannelStatusEvent event is the channel status for every channel running on the machine. The Connect and DoTick methods must be called for the ChannelStatusEvent event to be fired.
Note that controlStartTime and callStartTime parameters are not updated every second. Therefore, your code should increment the counters as need be. The ChannelStatusEvent for any specific channel is only fired when there is a change in controlName or status.
channel: Integer value (zero based) representing the channel number.
controlName: String representing the name of the VBVoice control in which the current channel is passing.
status: Integer value representing statustypes enumeration. See statusString.
controlStartTime: Long value representing the elapsed time, in milliseconds, that this channel is in the current control. This value is not modified when the call flow is in the same control. Your code should adjust its counter accordingly.
callStartTime: Long value representing the time, in milliseconds, that this channel is in the current call. This value is not modified while the call flow is in the same control. Your code should adjust its counter accordingly.
statusString: String value representing extra log message to be concatenated along with the status parameter. Use the statusString property to retrieve the actual log message string. For example, calling NLogViewer1.statusString(status, statusString) where status = 5 and statusString = ",,11" would return "dialling ,,11" for this specific channel.
linename: String value, currently not used.
appName: String value representing the application name such as "Ezflow.exe:2322"
Private Sub NLogViewer1_ChannelStatusEvent(ByVal channel As Integer,_
ByVal controlName As String, _
ByVal status As Integer, _
ByVal controlStartTime As Long, _
ByVal callStartTime As Long, _
ByVal statusString As String, _
ByVal linename As String, _
ByVal appName As String)
Debug.Print NLogViewer1.statusString(status, statusString)
(…)
End Sub
The ConnectionState event is fired after the Connect and DoTick methods are called. This event returns the connection state.
If State parameter = 1, then you are successfully connected to the
machine.
If State parameter = 0, then the connection failed.
Note that the Connect and DoTick methods must be called for the ConnectionState event to be fired.
state: Integer value of 0 or 1 representing whether you are successfully connected to the machine. A value of 1 means connection is successful , while a value of 0 means the connection failed.
Private Sub NLogViewer1_ConnectionState(ByVal state As Integer)
If state = 0 Then
'FAILED
Else
'SUCCEEDED
End If End Sub
All logging information is passed into this event -- it is the main log information.
channel: Integer value (zero based) representing the channel number.
eventType: Integer value representing the logmsgtypes enumeration. See NLog Enumerations in Appendix 3.
msg: String value representing the log message.
icon: An integer value representing VBVoice icons. The default value for icon is -1 and usually is represented by the treeicons warningbmp or 4.
Private Sub NLogViewer1_LogEvent(ByVal channel As Integer, _
ByVal eventType As Integer, _
ByVal msg As String, _
ByVal
icon As Integer)