Using MS Fax with Xbase++

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Charles Freeman (charlie[at]aeromed[dash]software[dot]com)
Date: 07/26/04

  • Next message: Ian McCulloch: "Re: Printing a received Fax"
    Date: Mon, 26 Jul 2004 09:30:13 -0400
    
    

    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


  • Next message: Ian McCulloch: "Re: Printing a received Fax"

    Relevant Pages

    • Re: object system...
      ... conflict with the actual sun and stars (so, ... Interface too can have some properties defined in terms of third types ... not the language or its target. ... If you ignore overflow exceptions, then necessary, the semantics becomes ...
      (comp.object)
    • Re: Great SWT Program
      ... not sure what the user interface of 2057 will be like, ... GUIs initially seemed to me. ... The clipboard will probably see big changes; ... difficult to program than in some other language. ...
      (comp.lang.java.programmer)
    • Re: Forth and Unix -- history
      ... Forth, as a language, gives you all the building blocks. ... So does FORTRAN, so does C, so does PERL, so does Python. ... to interface to some free library written in whatever language. ...
      (comp.lang.forth)
    • Re: object system...
      ... There's a reason why getters and setters exist. ... interface presumably implemented by the object. ... which need not know much about the language which ... I don't see any need for special features to do delegation. ...
      (comp.object)
    • Re: object system...
      ... for that you need machine language. ... there are many other cases where "abstraction" can be leveraged to the ... never have an interface to access not doing something. ... based on class systems rather than type systems. ...
      (comp.object)