How can I send/receive Fax via Tapi

  • Thread starter Thread starter Nguyen Xuan Nguyen
  • Start date Start date
N

Nguyen Xuan Nguyen

Dear sir

+. I'm using C#.Net and Tapi3.x for developing an simple phone.
+. In my Application I want to integrate send/receive Fax on it.
+. What should I do. I have saw MSDN. But I don't Understand, How do I
initialize Fax services.
+. In MSDN which it say: "The fax service calls the FaxDevStartJob
function to initialize new fax job".
BOOL WINAPI FaxDevStartJob(
HLINE LineHandle, // handle to the open line device
DWORD DeviceId, // TAPI line device identifier
PHANDLE FaxHandle, // pointer to fax handle
HANDLE CompletionPortHandle, // handle to an I/O completion port
ULONG_PTR CompletionKey // completion key value
);

Please help me:
+. What is LineHandle. How can I get it.
+. What is DeviceID. How can I get it.

Thanks
Nguyennx
 
Dear sir
My source code is here:

[DllImport("fxst30.dll")]
public static extern bool FaxDevStartJob(IntPtr hLine, uint
deviceIDSize, IntPtr faxHandle, IntPtr portHanle, IntPtr
completionKey);

[DllImport("fxst30.dll")]
public static extern bool FaxDevSend(IntPtr faxHandle, FAX_SEND
faxSend, IntPtr faxSendCallback);

[StructLayout(LayoutKind.Sequential)]
struct FAX_SEND
{
uint SizeOfStruct;
string FileName;
string CallerName;
string CallerNumber;
string ReceiverName;
string ReceiverNumber;
bool Branding;
IntPtr CallHandle;
IntPtr Reserved;
}

// basicCall is instal of ITBasicCallControl2
uint pdwSize;
IntPtr hLine = IntPtr.Zero;
IntPtr faxHandle = IntPtr.Zero;
IntPtr portHandle = IntPtr.Zero;
IntPtr completionKey = IntPtr.Zero;

///////////////////////////////////////////////////////////////////////
ITLegacyCallControl2 legacyCall = (ITLegacyCallControl2) basicCall;
legacyCall.GetIDGetID("tapi/line",out pdwSize, hLine);
FaxDevStartJob(hLine, pdwSize, faxHandle, portHandle, completionKey);
///////////////////////////////////////////////////////////////////////

FaxDevStartJob(hLine, pdwSize, faxHandle, portHandle, completionKey);

//??????????????????????????????????????????????????
//I want to send fax. What should I do ?
 
If you want to develop simple send/receive application, you can use Fax Com
API instead

You can use the link as starting point.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusing_4hd5.asp

Sample Program:

using System;
using FAXCOMExlib;

class Class1
{
static void Main(string[] args)
{

//To send fax with email receipts

FaxDocument faxdoc = new FaxDocument();

faxdoc.Recipients.Add("1000", "To number 1000");
faxdoc.Recipients.Add("1001", "To number 1001");

faxdoc.Subject = "This is sample fax";
faxdoc.Note = "Test.txt will be attached in the fax ";
faxdoc.Body = @".\test.txt";

faxdoc.Submit("faxServerName");
}

--
Loganatr [MSFT]
Microsoft Printing, Imaging and Fax Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.'



Nguyen Xuan Nguyen said:
Dear sir
My source code is here:

[DllImport("fxst30.dll")]
public static extern bool FaxDevStartJob(IntPtr hLine, uint
deviceIDSize, IntPtr faxHandle, IntPtr portHanle, IntPtr
completionKey);

[DllImport("fxst30.dll")]
public static extern bool FaxDevSend(IntPtr faxHandle, FAX_SEND
faxSend, IntPtr faxSendCallback);

[StructLayout(LayoutKind.Sequential)]
struct FAX_SEND
{
uint SizeOfStruct;
string FileName;
string CallerName;
string CallerNumber;
string ReceiverName;
string ReceiverNumber;
bool Branding;
IntPtr CallHandle;
IntPtr Reserved;
}

// basicCall is instal of ITBasicCallControl2
uint pdwSize;
IntPtr hLine = IntPtr.Zero;
IntPtr faxHandle = IntPtr.Zero;
IntPtr portHandle = IntPtr.Zero;
IntPtr completionKey = IntPtr.Zero;

///////////////////////////////////////////////////////////////////////
ITLegacyCallControl2 legacyCall = (ITLegacyCallControl2) basicCall;
legacyCall.GetIDGetID("tapi/line",out pdwSize, hLine);
FaxDevStartJob(hLine, pdwSize, faxHandle, portHandle, completionKey);
///////////////////////////////////////////////////////////////////////

FaxDevStartJob(hLine, pdwSize, faxHandle, portHandle, completionKey);

//??????????????????????????????????????????????????
//I want to send fax. What should I do ?



(e-mail address removed) (Nguyen Xuan Nguyen) wrote in message
Dear sir

+. I'm using C#.Net and Tapi3.x for developing an simple phone.
+. In my Application I want to integrate send/receive Fax on it.
+. What should I do. I have saw MSDN. But I don't Understand, How do I
initialize Fax services.
+. In MSDN which it say: "The fax service calls the FaxDevStartJob
function to initialize new fax job".
BOOL WINAPI FaxDevStartJob(
HLINE LineHandle, // handle to the open line device
DWORD DeviceId, // TAPI line device identifier
PHANDLE FaxHandle, // pointer to fax handle
HANDLE CompletionPortHandle, // handle to an I/O completion port
ULONG_PTR CompletionKey // completion key value
);

Please help me:
+. What is LineHandle. How can I get it.
+. What is DeviceID. How can I get it.

Thanks
Nguyennx
 
Dear sir
+. Thanks for your response.
+. I have used FAXCOMLib and FAXCOMxLib and I could send fax but ....I
want to use FaxDevStartJob function for developing simple fax.
+. What should I do ?

Loganatr said:
If you want to develop simple send/receive application, you can use Fax Com
API instead

You can use the link as starting point.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusing_4hd5.asp

Sample Program:

using System;
using FAXCOMExlib;

class Class1
{
static void Main(string[] args)
{

//To send fax with email receipts

FaxDocument faxdoc = new FaxDocument();

faxdoc.Recipients.Add("1000", "To number 1000");
faxdoc.Recipients.Add("1001", "To number 1001");

faxdoc.Subject = "This is sample fax";
faxdoc.Note = "Test.txt will be attached in the fax ";
faxdoc.Body = @".\test.txt";

faxdoc.Submit("faxServerName");
}

--
Loganatr [MSFT]
Microsoft Printing, Imaging and Fax Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.'



Nguyen Xuan Nguyen said:
Dear sir
My source code is here:

[DllImport("fxst30.dll")]
public static extern bool FaxDevStartJob(IntPtr hLine, uint
deviceIDSize, IntPtr faxHandle, IntPtr portHanle, IntPtr
completionKey);

[DllImport("fxst30.dll")]
public static extern bool FaxDevSend(IntPtr faxHandle, FAX_SEND
faxSend, IntPtr faxSendCallback);

[StructLayout(LayoutKind.Sequential)]
struct FAX_SEND
{
uint SizeOfStruct;
string FileName;
string CallerName;
string CallerNumber;
string ReceiverName;
string ReceiverNumber;
bool Branding;
IntPtr CallHandle;
IntPtr Reserved;
}

// basicCall is instal of ITBasicCallControl2
uint pdwSize;
IntPtr hLine = IntPtr.Zero;
IntPtr faxHandle = IntPtr.Zero;
IntPtr portHandle = IntPtr.Zero;
IntPtr completionKey = IntPtr.Zero;

///////////////////////////////////////////////////////////////////////
ITLegacyCallControl2 legacyCall = (ITLegacyCallControl2) basicCall;
legacyCall.GetIDGetID("tapi/line",out pdwSize, hLine);
FaxDevStartJob(hLine, pdwSize, faxHandle, portHandle, completionKey);
///////////////////////////////////////////////////////////////////////

FaxDevStartJob(hLine, pdwSize, faxHandle, portHandle, completionKey);

//??????????????????????????????????????????????????
//I want to send fax. What should I do ?



(e-mail address removed) (Nguyen Xuan Nguyen) wrote in message
Dear sir

+. I'm using C#.Net and Tapi3.x for developing an simple phone.
+. In my Application I want to integrate send/receive Fax on it.
+. What should I do. I have saw MSDN. But I don't Understand, How do I
initialize Fax services.
+. In MSDN which it say: "The fax service calls the FaxDevStartJob
function to initialize new fax job".
BOOL WINAPI FaxDevStartJob(
HLINE LineHandle, // handle to the open line device
DWORD DeviceId, // TAPI line device identifier
PHANDLE FaxHandle, // pointer to fax handle
HANDLE CompletionPortHandle, // handle to an I/O completion port
ULONG_PTR CompletionKey // completion key value
);

Please help me:
+. What is LineHandle. How can I get it.
+. What is DeviceID. How can I get it.

Thanks
Nguyennx
 
FaxDevStartJob is used to develop a Fax Service Provider. The Fax Service
comes with an extensible architecture wherein modem vendors can write their
own FSPs to utilise the capabilities of their modems better and plug in into
the service. Is that what you are attempting to do? If so, please look at
MSDN for documentation.

--
Manoj K Jain[MSFT]
Microsoft Printing, Imaging and Faxing
This posting isprovided "AS IS" with no warranties and confers no rights.
Please do not send mail directly to this aloas. This alias is for newsgroup
purposes only.
Nguyen Xuan Nguyen said:
Dear sir
+. Thanks for your response.
+. I have used FAXCOMLib and FAXCOMxLib and I could send fax but ....I
want to use FaxDevStartJob function for developing simple fax.
+. What should I do ?

Loganatr said:
If you want to develop simple send/receive application, you can use Fax
Com
API instead

You can use the link as starting point.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxusing_4hd5.asp

Sample Program:

using System;
using FAXCOMExlib;

class Class1
{
static void Main(string[] args)
{

//To send fax with email receipts

FaxDocument faxdoc = new FaxDocument();

faxdoc.Recipients.Add("1000", "To number 1000");
faxdoc.Recipients.Add("1001", "To number 1001");

faxdoc.Subject = "This is sample fax";
faxdoc.Note = "Test.txt will be attached in the fax ";
faxdoc.Body = @".\test.txt";

faxdoc.Submit("faxServerName");
}

--
Loganatr [MSFT]
Microsoft Printing, Imaging and Fax Team
This posting is provided "AS IS" with no warranties, and confers no
rights.
Please do not send email directly to this alias. This alias is for
newsgroup
purposes only.'



Nguyen Xuan Nguyen said:
Dear sir
My source code is here:

[DllImport("fxst30.dll")]
public static extern bool FaxDevStartJob(IntPtr hLine, uint
deviceIDSize, IntPtr faxHandle, IntPtr portHanle, IntPtr
completionKey);

[DllImport("fxst30.dll")]
public static extern bool FaxDevSend(IntPtr faxHandle, FAX_SEND
faxSend, IntPtr faxSendCallback);

[StructLayout(LayoutKind.Sequential)]
struct FAX_SEND
{
uint SizeOfStruct;
string FileName;
string CallerName;
string CallerNumber;
string ReceiverName;
string ReceiverNumber;
bool Branding;
IntPtr CallHandle;
IntPtr Reserved;
}

// basicCall is instal of ITBasicCallControl2
uint pdwSize;
IntPtr hLine = IntPtr.Zero;
IntPtr faxHandle = IntPtr.Zero;
IntPtr portHandle = IntPtr.Zero;
IntPtr completionKey = IntPtr.Zero;

///////////////////////////////////////////////////////////////////////
ITLegacyCallControl2 legacyCall = (ITLegacyCallControl2) basicCall;
legacyCall.GetIDGetID("tapi/line",out pdwSize, hLine);
FaxDevStartJob(hLine, pdwSize, faxHandle, portHandle, completionKey);
///////////////////////////////////////////////////////////////////////

FaxDevStartJob(hLine, pdwSize, faxHandle, portHandle, completionKey);

//??????????????????????????????????????????????????
//I want to send fax. What should I do ?



(e-mail address removed) (Nguyen Xuan Nguyen) wrote in message
Dear sir

+. I'm using C#.Net and Tapi3.x for developing an simple phone.
+. In my Application I want to integrate send/receive Fax on it.
+. What should I do. I have saw MSDN. But I don't Understand, How do I
initialize Fax services.
+. In MSDN which it say: "The fax service calls the FaxDevStartJob
function to initialize new fax job".
BOOL WINAPI FaxDevStartJob(
HLINE LineHandle, // handle to the open line device
DWORD DeviceId, // TAPI line device identifier
PHANDLE FaxHandle, // pointer to fax handle
HANDLE CompletionPortHandle, // handle to an I/O completion port
ULONG_PTR CompletionKey // completion key value
);

Please help me:
+. What is LineHandle. How can I get it.
+. What is DeviceID. How can I get it.

Thanks
Nguyennx
 
Back
Top