Foros del Web » Programación para mayores de 30 ;) » .NET »

Vb.net faxcomexlib event listener

Estas en el tema de Vb.net faxcomexlib event listener en el foro de .NET en Foros del Web. Buenas Ando algo desquiciado ya que estoy intentando capturar los eventos del fax, basicamente cuando cambia un mensaje de estado y cuando el servicio se ...
  #1 (permalink)  
Antiguo 26/08/2010, 05:40
 
Fecha de Ingreso: agosto-2010
Mensajes: 1
Antigüedad: 13 años, 8 meses
Puntos: 0
Vb.net faxcomexlib event listener

Buenas
Ando algo desquiciado ya que estoy intentando capturar los eventos del fax, basicamente cuando cambia un mensaje de estado y cuando el servicio se para, lo curioso del tema es que se me conecta al server pero se queda "sordo" no captura nada. Aqui pongo el código que estoy usando, que básicamente es el que esta en el MSDN. El servicio de fax funciona ya que tengo otras aplicaciones que mandan faxes por el mismo servidor sin ningun problema
Un saludo y gracias por adelantado

Código:
Public Class Form1
    Dim WithEvents g_objFaxServer As FAXCOMEXLib.FaxServer
    Dim pJobStatus As FAXCOMEXLib.FaxJobStatus

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Error handling
        On Error GoTo Error_Handler

        'Initialize the FaxServer object
        g_objFaxServer = New FAXCOMEXLib.FaxServer

        'Connect to the local fax server
        g_objFaxServer.Connect("")

        'Now register for the desired events
        g_objFaxServer.ListenToServerEvents( _
            FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetFXSSVC_ENDED + _
            FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE)

        'From now on, if the fax service has stopped, the function 
        'g_objFaxServer_OnServerShutDown() will be called, if a message is 
        'added to the outgoing queue, g_objFaxServer_OnOutgoingJobAdded() will 
        'be called, and if there is a change in the status of an outgoing job, 
        'g_objFaxServer_OnOutgoingJobChanged() will be called
        Exit Sub

Error_Handler:
        'Implement error handling at the end of your subroutine. This 
        'implementation is for demonstration purposes
        MsgBox("Error number: " & Hex(Err.Number) & ", " & Err.Description)
    End Sub
    Private Sub g_objFaxServer_OnOutgoingJobAdded(ByVal pFaxServer As FAXCOMEXLib.FaxServer, _
              ByVal bstrJobId As String)

        MsgBox("New job added to queue")

    End Sub

  

    Private Sub g_objFaxServer_OnOutgoingJobChanged(ByVal pFaxServer As FAXCOMEXLib.FaxServer, _
            ByVal bstrJobId As String, ByVal pJobStatus As FAXCOMEXLib.FaxJobStatus)
        'This event receives the FaxJobStatus object

        'Since this event is likely to result in errors, such as trying to 
        'report the transmission end time before the transmission has ended, 
        'this subroutine includes error handling

        'Error handling
        On Error GoTo Error_Handler


        'Display the FaxJobStatus object's properties when the event is called
        MsgBox(pJobStatus.AvailableOperations & _
        vbCrLf & "Caller ID: " & pJobStatus.CallerId & _
        vbCrLf & "CSID: " & pJobStatus.CSID & _
        vbCrLf & "Current page: " & pJobStatus.CurrentPage & _
        vbCrLf & "Device ID: " & pJobStatus.DeviceId & _
        vbCrLf & "Extended status: " & pJobStatus.ExtendedStatus & _
        vbCrLf & "Extended status code: " & pJobStatus.ExtendedStatusCode & _
        vbCrLf & "Job type: " & pJobStatus.JobType & _
        vbCrLf & "Pages: " & pJobStatus.Pages & _
        vbCrLf & "Retries: " & pJobStatus.Retries & _
        vbCrLf & "Routing information: " & pJobStatus.RoutingInformation & _
        vbCrLf & "Scheduled time: " & pJobStatus.ScheduledTime & _
        vbCrLf & "Size: " & pJobStatus.Size & _
        vbCrLf & "Status: " & pJobStatus.Status & _
        vbCrLf & "Transmission start: " & pJobStatus.TransmissionStart & _
        vbCrLf & "TSID: " & pJobStatus.TSID)

        'Display the transmission end time separately, as this will cause an error
        'while the transmission is still in progress
        MsgBox("Transmission end: " & pJobStatus.TransmissionEnd)

        Exit Sub

Error_Handler:
        'Implement error handling at the end of your subroutine. This 
        'implementation is for demonstration purposes
        MsgBox("Error number: " & Hex(Err.Number) & ", " & Err.Description)
    End Sub

    Private Sub g_objFaxServer_OnServerShutDown(ByVal pFaxServer As FAXCOMEXLib.IFaxServer)

        MsgBox("The local fax server has been shut down")

    End Sub


End Class

Etiquetas: eventos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:32.