Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sending fax from xHarbour

156 views
Skip to first unread message

Ash

unread,
May 12, 2013, 1:31:39 PM5/12/13
to
Hi,

Has anybody been able to send faxes from within an xHarbour program?

Any help would be welcome.

Thank you so much.
Ash

Enrico Maria Giordano

unread,
May 12, 2013, 1:35:51 PM5/12/13
to
Ash,

> Has anybody been able to send faxes from within an xHarbour program?

Try to print on Fax printer.

EMG

--
EMAG Software Homepage: http://www.emagsoftware.it
The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum
The Best of Spectrum Games: http://www.emagsoftware.it/tbosg
The EMG Music page: http://www.emagsoftware.it/emgmusic


dlzc

unread,
May 12, 2013, 4:31:32 PM5/12/13
to
Dear Enrico Maria Giordano:

On Sunday, May 12, 2013 10:35:51 AM UTC-7, Enrico Maria Giordano wrote:
>
> > Has anybody been able to send faxes from
> > within an xHarbour program?
>
> Try to print on Fax printer.

This would trigger a dialog, where the operator has to manually enter the FAX number.

You might see if the printer vendor has an API that would let you do what you want.

Additionally, this package might have an API that you can tie into without too much effort:
http://sourceforge.net/projects/wphf-reloaded/?source=directory

David A. Smith

Enrico Maria Giordano

unread,
May 12, 2013, 4:37:32 PM5/12/13
to
David,

> > Try to print on Fax printer.
>
> This would trigger a dialog, where the operator has
> to manually enter the FAX number.

True. Ash, try this:

oFax = CREATEOBJECT( "FaxComEx.FaxServer" )
oDoc = CREATEOBJECT( "FaxComEx.FaxDocument" )

oFax:Connect( "" )

oDoc:Body = cDoc // a Word document filename

oDoc:Recipients:Add( cFaxNumber )

oDoc:Recipients( 0 ):Name = cRecipient

oDoc:ConnectedSubmit( oFax )

oFax:Disconnect()

Michael Hagl

unread,
May 13, 2013, 5:25:35 AM5/13/13
to
Hi Ash,

customers who are using my xHb programm, do fax in several ways. All
solutions are working with special windows printer

1. AVM-ISDN-Card or AVM-Router (Fritzbox Phone) with Fritzfax-Software
(Windows printer), here there is a way to send the fax-number by program
(registry entry), but I don't know if this works outside of Europa
2. Tobit Faxware, very good, but expensive (transmitting number in printtext
with variables @@NUMMER +498752....@@)
3. Some customers have a swix telephone system, which can also fax
(swixfax), transmitting fax number in same way than Tobit


Michael Hagl


"Ash" <jun...@gmail.com> schrieb im Newsbeitrag
news:46831b4c-9110-4860...@y5g2000yqy.googlegroups.com...

jun...@gmail.com

unread,
May 13, 2013, 8:30:45 PM5/13/13
to
On Sunday, May 12, 2013 4:37:32 PM UTC-4, Enrico Maria Giordano wrote:
> David,
>
>

Gentlemen, thank you all for responding.

I am starting with Enrico's suggestion because being a Clipper programmer, I understand the code. I get the following error when I run a slightly modified version shown below.

Regards.
Ash

┌─────────────────────────────────────────────────────────┐
│ Error FaxComEx.FaxDocument/3 DISP_E_MEMBERNOTFOUND: │
│ RECIPIENTS Arguments: ( [ 1] = Type: N Val: 0) │
│ │
│ Quit │
└─────────────────────────────────────────────────────────┘
Error at ...: TOLEAUTO:RECIPIENTS(0) in Module:
Called from : MAIN(12) in Module: sendfax.prg


---- Code ------

FUNCTION main()

oFax = CREATEOBJECT( "FaxComEx.FaxServer" )
oDoc = CREATEOBJECT( "FaxComEx.FaxDocument" )

oFax:Connect( "" )

oDoc:Body = "test.txt" // a Word document filename

oDoc:Recipients:Add( "4165551212" )

oDoc:Recipients( 0 ):Name = "Joe Bloggs"

oDoc:ConnectedSubmit( oFax )

oFax:Disconnect()

------ Code End ------------

dlzc

unread,
May 14, 2013, 2:19:22 AM5/14/13
to
Dear jun...:

On Monday, May 13, 2013 5:30:45 PM UTC-7, jun...@gmail.com wrote:
> On Sunday, May 12, 2013 4:37:32 PM UTC-4, Enrico Maria Giordano wrote:
...
> I am starting with Enrico's suggestion because
> being a Clipper programmer, I understand the code.
> I get the following error when I run a slightly
> modified version shown below.

I do not know what has been implemented of the FaxComEx library. It may be documented in the source. However, in different variants, "recipients" is not defined:
http://www.interfax.net/en/dev/webservice/samples/fax_csharp_sendcharfax
... but "faxnumber" is.

David A. Smith

Enrico Maria Giordano

unread,
May 14, 2013, 4:49:28 AM5/14/13
to
Ash,

> I am starting with Enrico's suggestion because being a Clipper programmer,
> I understand the code. I get the following error when I run a slightly
> modified
> version shown below.

This sample works fine here:

FUNCTION MAIN( cTel )

LOCAL oFax := CREATEOBJECT( "FaxComEx.FaxServer" )

LOCAL oDoc := CREATEOBJECT( "FaxComEx.FaxDocument" )

IF EMPTY( cTel ); cTel = "0639728261"; ENDIF

oFax:Connect( "" )

oDoc:Body = CURDRIVE() + ":\" + CURDIR() + "\TEST.DOC"

oDoc:DocumentName = "Fax test"

oDoc:Recipients:Add( cTel )

oDoc:Recipients( 0 ):Name = "Enrico Maria Giordano"

oDoc:ConnectedSubmit( oFax )

oFax:Disconnect()

RETURN NIL

I'm using XP. Maybe it's changed in newer Windows versions.

jun...@gmail.com

unread,
May 14, 2013, 8:33:02 PM5/14/13
to
Enrico,

The program fails on the following line:

oDoc:Recipients( 0 ):Name = "Enrico Maria Giordano"

If I comment out this line, the program runs but I don't see any jobs being queued on the Windows Fax. There is a message, with a Cancel button, that flashes very quickly - I can see a hex-numbered filename ending with '.txt'. This number is different every time I run this program.

I will continue and report my findings here from time to time.

Thank you so much everybody.
Ash

jun...@gmail.com

unread,
May 15, 2013, 11:26:05 PM5/15/13
to
Hello Enrico,

The following program works after installing a new modem. Integration with Windows 7 Fax and Scan area is clean.

How does one get at the return code that indicates success or failure of sending a fax?

Thank you.
Ash



FUNCTION MAIN( cTel )

LOCAL oFax := CREATEOBJECT( "FaxComEx.FaxServer" )
LOCAL oDoc := CREATEOBJECT( "FaxComEx.FaxDocument" )
LOCAL jobID

IF EMPTY( cTel ); cTel = "4165551212"; ENDIF

oFax:Connect( "" )

oDoc:Subject = "Testing sending of Faxes"
oDoc:Body = "tests.docx"
oDoc:DocumentName = "Fax test"
oDoc:Recipients:Add( cTel, "Joe Bloggs" )
// oDoc:Recipients( 0 ):Name = "Joe Bloggs"
oDoc:ConnectedSubmit( oFax )

oFax:Disconnect()

RETURN NIL



dlzc

unread,
May 16, 2013, 10:21:29 AM5/16/13
to
Dear jun...:

On Wednesday, May 15, 2013 8:26:05 PM UTC-7, jun...@gmail.com wrote:
...
> How does one get at the return code that indicates
> success or failure of sending a fax?

> oDoc:ConnectedSubmit( oFax )
...
> oFax:Disconnect()

Windows API indicates that the FAX service can send an email to an address you specify (assuming we implement in xHarbour) via oFax:ReceiptAddress and oFax:ReceiptType
http://msdn.microsoft.com/en-us/library/windows/desktop/ms687514%28v=vs.85%29.aspx

In general, FAXes are logged. If you record oFax:SubmissionID (maybe prior to disconnecting), you can poll the log for that status.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms688641%28v=vs.85%29.aspx
... again, if we implemented this...

David A. Smith
0 new messages