有个示例可以发到邮箱供参考(注意下面的说明) Description =========== This is a project containing a set of objects that can be used to send a fax using the Windows XP Fax Services. A sample application has been included to give an idea of the functionality.
It also includes a very simple PDF object that allows a datawindow or datastore to be saved to a PDF file.
Once a fax has been sent Windows will use the in-built Fax Console to manage the queueing. You will be able to track the progress of the faxes here. It automatically keeps a list of queued faxes, a list of sent faxes and shows any faxes that have failed.
Redial attempts and time between redials can be configured from Control Panel | Phone and Modem Options
Cover pages can be designed using the in-built Cover Page Designer from the Fax Console
Requirements ============ 1. Must be running on at least Windows XP Home 2. A fax modem (internal or external) must be installed and configured 3. Windows XP Fax Services must be installed (see Windows Components in Add/Remove Programs) 4. If you want to create a PDF from a Powerbuilder datawindow then the Powerbuilder GhostScript stuff must be installed
How to Check for Necessary Components ===================================== 1. If Windows XP Fax Services are correctly installed then: a) <windir>\System32\fxscomex.dll should exist b) HKLM\Software\Classes\FaxComEx.FaxServer should exist in the registry
Known Issues ============ This has only been tested by connecting to a locally running server, i.e. Windows XP Fax Server which is part of Windows Xp Fax Services. In theory it should work with a remote fax server, but as I don't have one I can't test it
Things I know don't work on a local fax server:
1. Receipts don't appear to work, must be always set to ii_RECEIPTTYPE_NONE 2. Setting CoverPageType to local doesn't appear to work 3. Using parentheses doesn't work in many fields
I can't think of a way to trap the return codes/messages from the OLE objects, so I am only seeing the general Powerbuilder application error. If, for example, you enter a document name like this 'Doc1 (Test)' the code will fail, and I assume the OLE object (fxscomex.dll) is returning a nice code/message indicating why, however I don;t know how to trap it. Let me know if you have a way.
Futher Information ================== The following link is a good starting point in understanding the Windows XP Fax Service object model: