Documentation

Using WHFC with OLE

WHFC Home Contents Previous page  Next page


WHFC is capable as acting as an OLE-automation server. So you can use WHFC e.g. from Correl Office or Word macros and send faxes direct from Correl Office or Word. Some examples how to use the OLE interface can be found on the next page.

If you use functions which uses the windows printer manager and output a file, these functions return, before the entire file is written to disk. In this case you should insert a wait from approximately one second before calling WHFC. But this is a "feature" of the buffer cache algorithm of NT (currently i haven't got an idea for what this feature is useful, but i am in good mood to find a useful application which uses this feature ...)

The OLE interface is called "WHFC.OleSrv". It supports 6 functions :

BSTR GetPhoneBook(Index)

This function retrieves the name of the phonebook with the number Index. If the index is greater than the numbers of the phonebooks GetPhoneBook returns NULL.

You should use this function for getting information about all the phonebooks, WHFC is currently using. Start using this function with Index=0 and count up Index until the function returns NULL.

Index Short Indexnumber of a phonebook name (the first phonebook has index 0)
RETURN BSTR A String containing the name of the phonebook or NULL if the index is greater than the number of available phonebooks.

long SendFax(FileName, FaxNo, RmFile)

This function sends a postscript document to the HylaFAX server and returns the job id if the fax was submitted successfully. When you send to multiple fax addresses it returns the job id of the last transmitted job.

FileName String The filename of the document which should be submitted to the HylaFAX server. Make sure that this document is a postscript document.
FaxNo String The faxnumber. It's allowed to send a comma separated list of faxnumbers if you wish to send this document to multiple addresses.
RmFile BOOL If this argument is TRUE the document will be deleted after sending it to the HylaFAX server.
RETURN Long On Success the id of the last sended Job
-1 : Fax can not be send to the HylaFAX server
-2 : No valid Faxnumber
-4 : The file specified by FileName was not found

long SendFaxDlg(FileName, RmFile)

This function pops up the faxnumber dialog and asks for the faxnumber. It sends the document to the HylaFAX server and returns the job id if the fax was submitted successfully. When you send to multiple fax addresses it returns the job id of the last transmitted job.

FileName String The filename of the document which should be submitted to the HylaFAX server. Make sure that this document is a postscript document.
FaxNo String The faxnumber. It's allowed to send a comma separated list of faxnumbers if you wish to send this document to multiple addresses.
RmFile BOOL If this argument is TRUE the document will be deleted after sending it to the HylaFAX server.
RETURN Long On Success the id of the last sended Job
-1 : Fax can not be send to the HylaFAX server
-2 : No valid Faxnumber
-3 : Fax was aborted by user. The user has clicked on the cancel button on the faxnumber dialog
-4 : The file specified by FileName was not found

long SendFaxPhoneBook(FileName, FaxNo, PhoneBook, RmFile)

This function works like SendFax, but you can specify a phonebook. If there is an entry in FaxNo wich is not numeric, whfc checks the PhoneBook and tries to resolve the fax number.

FileName String The filename of the document which should be submitted to the HylaFAX server. Make sure that this document is a postscript document.
FaxNo String The faxnumber. It's allowed to send a comma separated list of faxnumbers if you wish to send this document to multiple addresses.
PhoneBook String The Phonebook which WHFC should use to resolve the faxnumbers.
RmFile BOOL If this argument is TRUE the document will be deleted after sending it to the HylaFAX server.
RETURN Long On Success the id of the last sended Job
-1 : Fax can not be send to the HylaFAX server
-2 : No valid Faxnumber
-4 : The file specified by FileName was not found
-5 : The phonebook specified by PhoneBook was not found
-6 : There was a problem on opening the phonebook
-7 : A phonebook entry in the faxnumber string was not found in the phonebook

BOOL AsyncSendFax(FileName)

This functions submits a document to the HylaFAX server. If this functions is called WHFC pops up the faxnumber dialog and asks for the faxnumbers etc. to submit. AsyncSendFax returns immediately without waiting for submitting the job. The document is removed after submitting the job to the HylaFAX server.

FileName String The filename of the document which should be submitted to the HylaFAX server. Make sure that this document is a postscript document.
RETURN Bool Currently always TRUE;

BOOL AsyncSendFaxDocDialog(FileName, DocName)

This functions submits a document with the document name to the HylaFAX server. If this functions is called WHFC pops up the faxnumber dialog including the document name and asks for the faxnumbers etc. to submit. AsyncSendFax returns immediately without waiting for submitting the job. The document is removed after submitting the job to the HylaFAX server.

This functions is used by the fax printer for informing WHFC about new fax jobs.

FileName String The filename of the document which should be submitted to the HylaFAX server. Make sure that this document is a postscript document.
DocName String The document name for displaying it in the fax number dialog
RETURN Bool Currently always TRUE;

New OLE Calls in WHFC 1.0.2

BSTR ResolveFaxNo(Alias, PhoneBook,ErrCode )

This function resolves a Faxnumber alias, defined in a phonebook and returns the associated faxnumbers.

Alias BSTR The faxnumber alias
Phonebook BSTR The phonebook, in which the alias should be searched
ErrCode SHORT The error code, if the function fails
RETURN BSTR A String with the fax numbers or NULL if the alias could not be found, or an other error occurred. Check then ErrCode for more infos.

LONG GetInfo(Alias, PhoneBook,FaxNo,To,Company,Location,VoiceNo, Remarks,Lpi )

This retrieves all information stored in a phonebook for an alias.

Alias BSTR The faxnumber alias
Phonebook BSTR The phonebook, in which the alias should be searched
FaxNo, To, Company, Location, VoiceNo, Remarks BSTR The information from the phonebook
Lpi SHORT Preferred resolution from the phonebook (0 = 98lpi 1 = 196 lpi)
RETURN LONG
 0 : On Success 
-2 : No valid Faxnumber
-5 : The phonebook specified by
     PhoneBook was not found
-6 : There was a problem on 
     opening the phonebook
-7 : The alias was not found
     in the phonebook 
Last updated: 03-Oct-2018 09:20