[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

FAXCOMEXLib ListenToServerEvents

babakm

5/3/2007 12:08:00 AM

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_SERVER_EVENTS_TYPE_ENUM.fsetIN_QUEUE );


faxServer.OnIncomingJobAdded+=new
FAXCOMEXLib.IFaxServerNotify_OnIncomingJobAddedEventHandler(faxServer_OnIncomingJobAdded);
faxServer.OnIncomingJobChanged+=new
FAXCOMEXLib.IFaxServerNotify_OnIncomingJobChangedEventHandler(faxServer_OnIncomingJobChanged);
faxServer.OnIncomingJobRemoved+=new
FAXCOMEXLib.IFaxServerNotify_OnIncomingJobRemovedEventHandler(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.FaxServer
pFaxServer, string bstrJobId, FAXCOMEXLib.FaxJobStatus pJobStatus)
{

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

private void faxServer_OnIncomingJobRemoved(FAXCOMEXLib.FaxServer
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