FaxSendDocument API from Delphi

Posted on 2004-03-25
Last Modified: 2013-11-13
Is there a way to call the FaxSendDocument and FaxStartFaxServer APIs from Delphi 6?

Thanks in advance!

Question by:A1ternity
  • 2
  • 2
LVL 19

Accepted Solution

Melih SARICA earned 500 total points
ID: 10685194

first there is no Ip Called FaxStartFaxServer .

here is the convertion on the API fuctions of 3 basic Functions ( connecting ..Sending , and closing) ( at the end of the emssage)

But Also microsoft Advice us to use Faxserver Com Objects..

Faxserver has 3 sub Objects
                 FaxJobs, FaxPorts and FaxDoc objects.

How to  Send a Document with this objects
************* Fax sending with Com Objects *****************
Procedure ConnectAndSendFaxDocument
        mFaxServer      : variant;
        mFaxDocument    : variant;
        mfaxserver :=CreateOleObject('FaxServer.FaxServer');
        mfaxServer.Connect('MyFaxserver');  // if this parameter is null then connect to localhost

here is the link of microsoft help about Faxserver Com Object

************** Unit Winfax *****************
unit winfax;
//  Object      : Winfax.dll WinAPI Functions
//  Author      : Non Zero ( Melih SARICA)
//  Date        : 26/04/2004
//  Status      : Not Fully Convereted

uses windows;

   HCall                = Cardinal;
  _FAX_JOB_PARAM = record
        SizeOfStruct            : dword;        //structure size, in bytes
        RecipientNumber         : Pchar;        //pointer to recipient's fax number
        RecipientName           : Pchar;        //pointer to recipient's name
        Tsid                    : Pchar;        //pointer to transmitting station identifier
        SenderName              : Pchar;        //pointer to sender's name
        SenderCompany           : Pchar;        //pointer to sender's company
        SenderDept              : Pchar;        //pointer to sender's department
        BillingCode             : PChar;        //pointer to billing code
        ScheduleAction          : Dword;        //job scheduling action code
        ScheduleTime            : SYSTEMTIME;   //time to send fax
        DeliveryReportType      : dword;        //e-mail delivery report type
        DeliveryReportAddress   : Pchar;        //pointer to e-mail address
        DocumentName            : Pchar;        //pointer to document name to display
        CallHandle              : Hcall;        //reserved
        Reserved                : array [0..2] of byte;   //must be zero

 function FaxConnectFaxServer(
  MachineName   : Pchar;  // fax server name    ' null if localcomputer
  FaxHandle     : PHandle         // handle to the fax server
        ):longbool;safecall; external 'winfax.dll' name 'FaxConnectFaxServerA';

 function FaxClose(
  FaxHandle     :  THandle // fax handle to close
        ):longbool;safecall; external 'winfax.dll';

  function  FaxSendDocument(
  FaxHandle     : THandle;          // handle to the fax server
  FileName      : Pchar;            // file with data to transmit
  JobParams     : PFAX_JOB_PARAM;   // pointer to job information structure
  FAX_COVERPAGE_INFO : pointer ;    // Normally it must be a structure but i dont use it .. so it ll be nil in my codes
  FaxJobId      : PDWORD            // fax job identifier
        ):longbool;safecall; external 'winfax.dll';



Author Comment

ID: 10687254
Actually I found out that the jedi project has translated winfax.h to delphi. So using this API is now pretty easy.
Still, here are your points!
LVL 19

Expert Comment

by:Melih SARICA
ID: 10687667
Where are they ? where are they? :p


Author Comment

ID: 10687679
lol there you go :)

Thanks again!

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
count8 challlenge 13 118
Specific format 21 181
what is the main difference between git clone and fetch ann pull and push commands 2 72
Image decoding from Camera 3 72
Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now