422,764 Members | 1,289 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,764 IT Pros & Developers. It's quick & easy.

Handling Events with FAXCOMEXLib

P: n/a
Hello Everyone and thanks for your help in advance. I am working on a
project that requires the programming of the MS Fax Service. I need to be
able to react to events, specifically and incoming fax. I have looked at the
documentation for programming and there are some VB6 examples, such as:

http://msdn.microsoft.com/library/de...using_8hlv.asp

However, when I try to convert the code to VB.Net, either I am missing
something or the example doesn’t work. Here is my code:

<code>

Dim WithEvents objFaxServer As New FAXCOMEXLib.FaxServerClass
Dim _JobStatus As FAXCOMEXLib.FaxJobStatus

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Try

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

'Now register for the desired events.

objFaxServer.ListenToServerEvents(FAXCOMEXLib.FAX_ SERVER_EVENTS_TYPE_ENUM.fsetINCOMING_CALL)

Catch ex As Exception

End Try
End Sub

Private Sub g_objFaxServer_OnIncomingJobAdded(ByVal pFaxServer As
FAXCOMEXLib.IFaxServer, ByVal bstrJobId As String)

MsgBox("New job added to queue")
Label1.Text = "New Message"

End Sub

</code>

It would appear that there is no wiring to the event handler. I have fooled
with a number of ways to get the handler set up, but can’t seem to get it
figured out. Any help on this issue would be greatly appreciated.

Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.