User`s manual

ActFax User’s Manual 26
Data fields can be added the same way as printer commands; they are written directly to the
document. Named Pipes can be used as an alternative when you do not want to work with
the Windows graphic subsystem (GDI).
Take care that Named Pipes are only available on fax servers running on Windows XP / 2003
/ Vista / 2008 / 7 / 2012 / 8 / 10 systems.
To use Named Pipes, just a few small modifications have to be done in your application. Follow
these steps to integrate the communication through Named Pipes with your application:
The Named Pipe needs to be configured on the fax server. To do so, choose the menu
option Communication / RAW Server and create a new entry for a NetBeui connection. The
name of the Named Pipe can be individually chosen (the default pipe name is ActiveFax).
Open the Named Pipe with writing permission in your application. This can be done with
normal API file functions. The file name is built in the format \\servername\pipe\pipe-
name” (i.e. \\faxserver\pipe\activefax). To open a Named Pipe, use the API function call
CreateHandle() or any corresponding function of your programming language.
Send the fax message directly to the previously opened file. You can use the API function
call WriteFile() or any corresponding function of your programming language to write the
data to the file. It is also possible to use printer commands and data fields in that case.
Close the Named Pipe with the API function call CloseHandle() or any corresponding func-
tion of your programming language. By closing the file (Named Pipe), the fax server auto-
matically gets a signal that the fax message has been finished and can be transmitted.
The function calls for opening, writing and closing files (Named Pipes) may be known under
different names, depending on your programming language. More information about imple-
mentation of files and Named Pipes can be found in the documentation of your development
tool (i.e. Visual-C, Visual Basic, Delphi, Power Builder, ...).
3.1.4.1. Example in Programming Language C
#include <windows.h>
HANDLE hFile;
DWORD dwError;
BYTE szText[1024];
BYTE szFax[128];
DWORD dwWritten;
int main(void)
{
hFile = CreateFile("\\\\faxserver\\pipe\\activefax",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
if (hFile == INVALID_HANDLE_VALUE) {
dwError = GetLastError();
return 1;