- Joined
- Jul 25, 2006
- Messages
- 6
- Reaction score
- 0
hi all i have a problem with recieving fax:
i am using win xp , FAXCOMEXLib and c# 2005. i tried to send fax and it work good but when i try to recieve the fax it didn't work !! the OnNewCall event didn't work !!and the other events are worked good.
so can any body help me in that ! thanx...
this is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using FAXCOMEXLib;
namespace WindowsApplication2
{
publicpartialclassForm1 : Form
{
public FAXCOMEXLib.FaxServerClass fserver;
public Form1()
{
InitializeComponent();
}
privatevoid Form1_Load(object sender, EventArgs e)
{
fserver = new FAXCOMEXLib.FaxServerClass();
string machineName = System.Environment.MachineName;
fserver.Connect(machineName);
FAXCOMEXLib.FaxDevice fdc = (FaxDeviceClass)fserver.GetDevices()[0];
fdc.ReceiveMode = FAX_DEVICE_RECEIVE_MODE_ENUM.fdrmAUTO_ANSWER;
fdc.RingsBeforeAnswer = 1;
fserver.ListenToServerEvents(FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetINCOMING_CALL | FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetFXSSVC_ENDED | FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_ARCHIVE);
fserver.OnNewCall += newIFaxServerNotify_OnNewCallEventHandler(fserver_OnNewCall);
fserver.OnServerShutDown += newIFaxServerNotify_OnServerShutDownEventHandler(fserver_OnServerShutDown);
fserver.OnOutgoingMessageAdded += newIFaxServerNotify_OnOutgoingMessageAddedEventHandler(fserver_OnOutgoingMessageAdded);
}
void fserver_OnOutgoingMessageAdded(FaxServer pFaxServer, string bstrMessageId)
{
MessageBox.Show(" Message sent ");
}
void fserver_OnNewCall(FaxServer pFaxServer, int lCallId, int lDeviceId, string bstrCallerId)
{
MessageBox.Show("There is a new call.");
}
void fserver_OnServerShutDown(FaxServer pFaxServer)
{
MessageBox.Show(" Shut Down Event Fired ");
}
}
}
i am using win xp , FAXCOMEXLib and c# 2005. i tried to send fax and it work good but when i try to recieve the fax it didn't work !! the OnNewCall event didn't work !!and the other events are worked good.
so can any body help me in that ! thanx...
this is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using FAXCOMEXLib;
namespace WindowsApplication2
{
publicpartialclassForm1 : Form
{
public FAXCOMEXLib.FaxServerClass fserver;
public Form1()
{
InitializeComponent();
}
privatevoid Form1_Load(object sender, EventArgs e)
{
fserver = new FAXCOMEXLib.FaxServerClass();
string machineName = System.Environment.MachineName;
fserver.Connect(machineName);
FAXCOMEXLib.FaxDevice fdc = (FaxDeviceClass)fserver.GetDevices()[0];
fdc.ReceiveMode = FAX_DEVICE_RECEIVE_MODE_ENUM.fdrmAUTO_ANSWER;
fdc.RingsBeforeAnswer = 1;
fserver.ListenToServerEvents(FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetINCOMING_CALL | FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetFXSSVC_ENDED | FAXCOMEXLib.FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_ARCHIVE);
fserver.OnNewCall += newIFaxServerNotify_OnNewCallEventHandler(fserver_OnNewCall);
fserver.OnServerShutDown += newIFaxServerNotify_OnServerShutDownEventHandler(fserver_OnServerShutDown);
fserver.OnOutgoingMessageAdded += newIFaxServerNotify_OnOutgoingMessageAddedEventHandler(fserver_OnOutgoingMessageAdded);
}
void fserver_OnOutgoingMessageAdded(FaxServer pFaxServer, string bstrMessageId)
{
MessageBox.Show(" Message sent ");
}
void fserver_OnNewCall(FaxServer pFaxServer, int lCallId, int lDeviceId, string bstrCallerId)
{
MessageBox.Show("There is a new call.");
}
void fserver_OnServerShutDown(FaxServer pFaxServer)
{
MessageBox.Show(" Shut Down Event Fired ");
}
}
}