C
Charles Freeman
MSFT gurus,
I am attempting to develop a simple interface to MS Fax (i.e. the "Local"
fax) from within the Xbase++ language, which is a 32 bit Windows
database-oriented language. Xbase has the ability to hook external DLLs
rather easily, but not the ability to call COM objects natively (until the
next release). Thus I need to use the Win32 interface methodology.
After a weekend of work I can successfully:
1) Link the DLL (I am linking Winfax.dll - is this right?)
2) Get a FaxServer handle with FaxConnectFaxServerA
3) Get a FaxPort structure with FaxEnumPortsA and extract a DeviceID
4) Use the DeviceID with FaxOpenPort and return a FaxPort handle
(I plan to use this handle to look at the progress and results of the
outgoing fax - not done yet)
5) Call the FaxSendDocumentA function with parameters as follows:
FaxSendDocumentA(hFaxHandle, cFileName, cFaxJobParam, CNULL, nFaxJobId )
.. However, this call returns the error:
ERROR_INVALID_DATA
According to the documentation for FaxSendDocument, this means that either
the filename I am trying to fax cannot be opened or the coverpage structure
is a problem. In my case I am using a NULL in the structure (0x00000000) for
the coverpage element, as the documentation says to do if I don't want a
coverpage.
My sample file that I am trying to fax is "C:\TEST\SAMPLE.TIF", a sample
two-page TIFF file in the correct fax resolution that I created for testnig
purposes. (I've also tried sending a TXT file with the same results). I'm
fully qualifying the path as you can see, and sending the zero-terminated
string as a string pointer to the function (based upon by other work
creating interfaces to Winsock this seems to be what an LPCTSTR means to
Xbase++.)
I'm pretty sure that my FAX_JOB_PARAM structure is correct, since in the
development phase leading up to this point it wasn't and the function gave
me an
ERROR_INVALID_PARAMETER
message instead.
Any ideas? Does FaxSendDocument not work with TIFF files?
I look for to your reply. This is the last little task before I can release
this particular program to my clients.
Charlie
I am attempting to develop a simple interface to MS Fax (i.e. the "Local"
fax) from within the Xbase++ language, which is a 32 bit Windows
database-oriented language. Xbase has the ability to hook external DLLs
rather easily, but not the ability to call COM objects natively (until the
next release). Thus I need to use the Win32 interface methodology.
After a weekend of work I can successfully:
1) Link the DLL (I am linking Winfax.dll - is this right?)
2) Get a FaxServer handle with FaxConnectFaxServerA
3) Get a FaxPort structure with FaxEnumPortsA and extract a DeviceID
4) Use the DeviceID with FaxOpenPort and return a FaxPort handle
(I plan to use this handle to look at the progress and results of the
outgoing fax - not done yet)
5) Call the FaxSendDocumentA function with parameters as follows:
FaxSendDocumentA(hFaxHandle, cFileName, cFaxJobParam, CNULL, nFaxJobId )
.. However, this call returns the error:
ERROR_INVALID_DATA
According to the documentation for FaxSendDocument, this means that either
the filename I am trying to fax cannot be opened or the coverpage structure
is a problem. In my case I am using a NULL in the structure (0x00000000) for
the coverpage element, as the documentation says to do if I don't want a
coverpage.
My sample file that I am trying to fax is "C:\TEST\SAMPLE.TIF", a sample
two-page TIFF file in the correct fax resolution that I created for testnig
purposes. (I've also tried sending a TXT file with the same results). I'm
fully qualifying the path as you can see, and sending the zero-terminated
string as a string pointer to the function (based upon by other work
creating interfaces to Winsock this seems to be what an LPCTSTR means to
Xbase++.)
I'm pretty sure that my FAX_JOB_PARAM structure is correct, since in the
development phase leading up to this point it wasn't and the function gave
me an
ERROR_INVALID_PARAMETER
message instead.
Any ideas? Does FaxSendDocument not work with TIFF files?
I look for to your reply. This is the last little task before I can release
this particular program to my clients.
Charlie