FaxMan NT 4 Printer Driver/Monitor 
----------------------------------

The NT 4.0 Printer Driver now supports interfacing with your DLL directly. You are now able to use your own DLL to handle the Print notifications instead of using the FaxMan DLL or OCX. This allows the driver to run without using the faxman dll and allows user to define their own methods for generating print job filenames.


Installation
------------------------------------------

To install the new port monitor you need to:

1. At a Command prompt type: NET STOP SPOOLER
2. Copy the dtmon.dll file over the old file located in windows/system32
3. At a Command prompt type: NET START SPOOLER

The new monitor is now installed.


Using an Interface DLL
------------------------------------------

The monitor can now call a user specified interface DLL instead of generating the
standard FaxMan messages during a print job. The DLL receives two notifications, the 
first is called during the start of a print job and requires the DLL to provide a filename
for the print job, the second is fired when the job is complete.


The Interface DLL must contain functions having the
following  attributes:

#include <windows.h>
#include "..\server\portable.h"
#include "..\server\faxdll.h"

// Portname is the Name of the Port
// DocName is the name of the document being printed
// lpFilename points to the buffer into which the app should copy the filename of the output file.
// Note that this is an ANSI string not UNICODE as are the other strings
// BufLen is the length of the buffer pointed to by lpFilename, you should not copy > BufLen chars into
// the buffer pointed to by lpFilename

// This function must copy a filename to the lpFileName buffer otherwise the monitor will fail the job and 
// display the dreaded 'Unable to get fileName for port: xxxx' dialog.

void  _declspec(dllexport) WINAPI FaxGetFileName( LPWSTR PortName, LPWSTR DocName, LPSTR lpFilename, int BufLen )
{
	strcpy( lpFilename, "c:\\myfilename.fmf" );
}


// PortName is the Name of the Port
// pStat is a FaxMan PRINTSTAT structure that contains info related to the print job.

void  _declspec(dllexport) WINAPI FaxPrintComplete( LPWSTR PortName, PPRINTSTAT pStat )
{
	OutputDebugString("\r\nIFDLL: PrintComplete Fired");
}



Note that the functions must be declared as noted since the monitor uses the function names and not
ordinals to obtain the entry points. In that case the Monitor logs the failure to load the DLL in the NT event
monitor.

The DLL path specified in the Monitor Port Configuration/Add dialog must include the complete path
to the DLL. The DLL location is stored in the Registry at under the key:

HKEY_LOCAL_MACHINE\Software\FaxManPorts\<PortName>\InterfaceDLL


If you have any questions or problems please email us at support@data-tech.com or
call us at 704-682-0161.

Thanks,
The FaxMan Team
Data Techniques, Inc.
