COMSTAT.DLL - COM Port Status version 1.0
(c) Copyright 1994 Lim Chee Tuck

Description:  This is a VB callable DLL that checks the current state of the
COM port.  Especially designed for modem software, it will check the state
of the following singals even if the COM port is opened and being used by
another application !

	RLSD    Receive Line Signal Detect; or Carrier Detect (CD)
	CTS     Clear To Send
	DSR     Data Set Ready
	RI      Ring Indicator

Installation:	You should copy the COMSTAT.DLL file into your windows directory
or any other place that is in the search path.  If VB cannot find the DLL, you
can explicitly specify that location of the DLL in the Declare statement.

Usage:	There are four functions in the DLL, namely, CheckCD, CheckCTS,CheckDSR
and CheckRI.  Before you can you them, like usual, you must declare them first.
You can use the COMSTAT.TXT file included in the COMSTAT1.ZIP file or
alternatively type the following code yourself.

Declare Function CheckCD Lib "comstat.dll" (ByVal CommPort As Integer) As Integer
Declare Function CheckCTS Lib "comstat.dll" (ByVal CommPort As Integer) As Integer
Declare Function CheckDSR Lib "comstat.dll" (ByVal CommPort As Integer) As Integer
Declare Function CheckRI Lib "comstat.dll" (ByVal CommPort As Integer) As Integer

Parameter:	There are only one parameter to be passed for all four functions.
CommPort parameter specifies which COM port to check.  1 for COM1, 2 for COM2 and
so on.

Return:	The return value is an integer which can also be looked as a boolean data
type.  That is, 1 means "ON" and 0 means "OFF".

Comment:  If the COM port is not open or an invalid COM port, it will return
0.  This version improved on this kind of error handling but I don't know if
there is any other possibility which will cause a GPF.  Please report if you
encounter any.

Known bugs:	The CheckRI function doesn't work very well, still under testing.
Please report if you found any error.

Example:
	If CheckCD(4) Then
   	    bla bla bla...	'CD is high, do your stuff here.
	End If

Final word:	COM Port Status is distributed as shareware.  You may use it
for 30 days to evaluate its usefulness.  If you like it and continue to use it after
30 days, you must register. Registration costs US$10.  Print "order.frm" or just write
a letter giving your name and address, and say you are registering for COM Port
Status version 1.0.  Send it with an _international money order_ (no cash, please)
to my agent GLOCOM TRADING at the following address:

		GLOCOM TRADING
		P.O. Box 8250,
		46785 Petaling Jaya,
		MALAYSIA

IMPORTANT:	By registering, you will be granted a single-user, non-exclusive,
non-distributable license to it on a single host.  If you want to distribute COM
Port Status with your product, please contact the author directly for a royalty-
free license.  This royalty-free license is consider on case-by-case basis.

The author can also be contacted for comments and problems at:
Internet: lim@ctuck.pl.my
Phone: +603-717-5963
Fax: +603-777-2095

DISCLAIMER:
THE AUTHOR MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS
SOFTWARE OR ABOUT ANY CONTENT OR INFORMATION MADE ACCESSIBLE BY THE
SOFTWARE, FOR ANY PURPOSE.  THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT
EXPRESS OR IMPLIED WARRANTIES, INCLUDING WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.  THE ENTIRE RISK
AS TO THE RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY YOU.

IN NO EVENT WILL THE AUTHOR BE LIABLE TO YOU FOR ANY CONSEQUENETIAL,
INCIDENTAL OR INDIRECT DAMAGES (INCLUDING DAMAGES FOR LOSS OF BYSINESS
PROFITS, BUSINESS INTERRUPTION LOSS OF BUSINESS IMPORMATION, AND THE LIKE)
ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE EVEN IF THE AUTHOR
HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.