HighTechTalks DotNet Forums  

FAXCOMEXLib ListenToServerEvents

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss FAXCOMEXLib ListenToServerEvents in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
babakm
 
Posts: n/a

Default FAXCOMEXLib ListenToServerEvents - 05-02-2007 , 08:08 PM






I am developing a fax application using FAXCOMEXLib for Windows XP and 2003
using .NET windows form application. I am in the steps of registring Event
notifications from the Fax Server where I am having some problems. I have
registered event types to listen to via ListenToServerEvents function but
when I receive incomign faxes only the OnOutgoingJobAdded and
OnIncomingJobRemoved events are being fired. The OnIncomingJobChanged event
never gets fired. I would like to get the status of the fax such as the
current page being received, if the job was cancelled by the user, etc.

My code is below:


==================== code start ==================

FAXCOMEXLib.FaxServerClass faxServer;

private void Form1_Load(object sender, System.EventArgs e)
{

faxServer = new FAXCOMEXLib.FaxServerClass();
faxServer.Connect("");

faxServer.ListenToServerEvents(FAXCOMEXLib.FAX_SER VER_EVENTS_TYPE_ENUM.fsetIN_QUEUE );


faxServer.OnIncomingJobAdded+=new
FAXCOMEXLib.IFaxServerNotify_OnIncomingJobAddedEve ntHandler(faxServer_OnIncomingJobAdded);
faxServer.OnIncomingJobChanged+=new
FAXCOMEXLib.IFaxServerNotify_OnIncomingJobChangedE ventHandler(faxServer_OnIncomingJobChanged);
faxServer.OnIncomingJobRemoved+=new
FAXCOMEXLib.IFaxServerNotify_OnIncomingJobRemovedE ventHandler(faxServer_OnIncomingJobRemoved);

}


private void faxServer_OnIncomingJobAdded(FAXCOMEXLib.FaxServer pFaxServer,
string bstrJobId)
{
Log("IN - Job ID: " + bstrJobId + " Job Added to Fax Queue");
}


private void faxServer_OnIncomingJobChanged(FAXCOMEXLib.FaxServ er
pFaxServer, string bstrJobId, FAXCOMEXLib.FaxJobStatus pJobStatus)
{

Log("IN - Job ID: " + bstrJobId + " " +
pJobStatus.ExtendedStatus.ToString() + " " +
pJobStatus.CurrentPage.ToString());
}

private void faxServer_OnIncomingJobRemoved(FAXCOMEXLib.FaxServ er
pFaxServer, string bstrJobId)
{
Log("IN - Job ID: " + bstrJobId + " Job Removed from Fax Queue");
}

public void Log(string str)
{
txtStatus.Text = DateTime.Now.ToString() + ": " + str + "\r\n" +
txtStatus.Text;
}

==================== code end ==================

Any help would be appreciated.
Thanks
Babak


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.