[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  OpenComm( cDevice, nInBuffSize, nOutBuffSize )-> <hComDev>
------------------------------------------------------------------------------


 PARAMETER:

  <cDevice>      Is a string with the name of the target communciation 
                 device control to open, like "COM1" or "LPT1" 

  <nInBuffSize>  Specifies the size, in bytes, of the receiving queue. The
                 size is set to 1024 Bytes by default. This parameter is
                 ignored for LPT devices. 

  <nSizeOut>     Specifies the size, in bytes, of the transmission queue. By
                 default, it is set to 128 bytes. This parameter is ignored
                 for LPT devices.


 RETURNS:

  <hComDev> is a numeric identifier for that opened device, or less than
  zero if the function could not open the device, representing one of the 
  following error codes :

    IE_BADID    [ -1] device identifier is invalid or unsupported
    IE_BAUDRATE [-12] device's baud rate is not supported
    IE_BYTESIZE [-11] specified byte size is invalid
    IE_DEFAULT  [ -5] default parameters are in error
    IE_HARDWARE [-10] hardware is not available (locked by another device)
    IE_MEMORY   [ -4] function cannot allocate the queue buffers
    IE_NOPEN    [ -3] device is not open
    IE_OPEN     [ -2] device is already open

  If this function is called with both queue sizes set to zero, the return
  value is IE_OPEN if the device is already open or IE_MEMORY if the device
  is not open.



 DESCRIPTION:

  The OpenComm function opens a communications device. Windows allows COM
  ports 1 through 9 and LPT ports 1 through 3. If the device driver does not
  support a communications port number, OpenComm() will fail.
  The communications device is initialized to a default configuration. The
  SetCommState function should be used to initialize the device to alternate
  values.
  The receiving and transmission queues are used by interrupt-driven device
  drivers. LPT ports are not interrupt driven--for these ports, the 
  <nInBuffSize> and <nOutBuffSize> parameters are ignored and the queue
  size is set to zero.

  Please refer to the SAMPLE\TESTCOMM.PRG for an detailed example of how to
  use this function(s)


 SOURCE:

  SOURCE\WINAPI\COMM.C



See Also: CloseComm BuildCommDCB FlushComm ReadComm SetCommState WriteComm
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson