setcommstate

[TRMW]
setcommstate= 0 or 1

normally specified in [TRMW] only.

The default is 1 on Windows 9x/Me, and 0 on other versions. This value enables a workaround for a bug in Windows 95. This bug also affects the 16 bit version of DP4, but unfortunately the same work around is not available.

The bug is as follows:

When DP4 prints to a printer that uses COM1 or COM2 it does not configure the port baud rate etc but assumes that this has been set up by running the mode command or some equivalent. This works perfectly well on Windows 3.x and Windows NT, but not on Windows 95. (It is documented as a valid technique by Microsoft so this is a bug in the Windows 95 OS).

The work around we have added is that if the value of SetCommState in the [trmw] section of the DP4 configuration file is 1 then trmw32.dll will initialise the port according to the values contained in the appropriate entry in the [ports] section of win.ini. The value of these entries can be configured using Control Panel.(Right click on My computer, select Properties, the Device Manager Tab,Open the Ports entry,double click on the port you want to configure and click on the Port Settings tab). SetCommState defaults to 1 on Windows 9x and 0 on other versions of Windows so there should not normally be any need to set it explicity. It would be preferable to use an appropriate entry from the registry to configure the serial port. However there does not appear to be a documented way of accessing the port information (it is stored in a different way in Windows NT from Windows 9x).