Platform SDK: Fax Services |
In most situations, a fax client application must establish a connection to a fax server before the application can use other fax features.
To establish the connection to a fax server, a fax client application must call the FaxConnectFaxServer function successfully before it calls any other fax client function. FaxConnectFaxServer returns a fax server handle that is required to call many other fax client functions.
Note that a connection to a fax server is not required to print a fax document to a fax printer device context. An application can provide transmission information directly to the fax client graphics device interface (GDI) functions, and transmit the active document by printing it to a printer device context. The fax client GDI functions include the FaxStartPrintJob and the FaxPrintCoverpage functions. For more information, see Printing a Fax to a Device Context.
Call the FaxClose function to disconnect from the fax server and deallocate the handle that the FaxConnectFaxServer function returns.
If you are writing a C/C++ application, you must call the CoCreateInstance function to retrieve a pointer to an IFaxServer interface and create an instance of a FaxServer object. Then you must call the IFaxServer::Connect method to initiate a connection with an active fax server. The server connection is required before the application can access most interfaces that begin with IFax. (A fax server connection is not required to access an IFaxTiff interface.) For more information about creating a FaxServer object, and for a list of properties and methods, see IFaxServer.
If you are writing a Visual Basic application, you must call the Visual Basic CreateObject function to create an instance of a FaxServer object. Then you must call the Connect method of the FaxServer object to initiate a connection with an active fax server. The server connection is required before the application can access most other objects that begin with Fax. (A fax server connection is not required to access a FaxTiff object.) See FaxServer object (Visual Basic) for more information about the steps required to create the object, and for a list of properties and methods of the object.
For more information, see Disconnecting from a Fax Server.