OpenComm(<port>, <in_q>, <out_q>) Argument Description ----------------------------------------------------------------- <port> Points to a null-terminated string that specifies the device in the form COM<n> or LPT<n>, where <n> is the device number. <in_q> Specifies the size, in bytes, of the receiving queue. This parameter is ignored for LPT devices. <out_q> Specifies the size, in bytes, of the transmission queue. This parameter is ignored for LPT devices.
Value Meaning -------------------------------------------------------------------- -12 The device's baud rate is unsupported. -11 The specified byte size is invalid. -10 The hardware is not available (is locked by another device). -5 The default parameters are in error. -4 The function cannot allocate the queues. -3 The device is not open. -2 The device is already open. -1 The device identifier is invalid or unsupported.
*-------------------- dialer.prg ------------------------ * Sample program to output to comm port * Uses FoxTools library for generic DLL access SET LIBRARY TO SYS(2004)+"foxtools.fll" ADDITIVE opencomm = REGFN("OpenComm", "CII", "I") writecomm = REGFN("WriteComm", "ICI", "I") closecomm = REGFN("CloseComm", "I", "I") com1 = CALLFN(opencomm, "COM1:", 100, 100) s = "ATDT 5551212" + chr(13) =CALLFN(writecomm, com1, s, len(s)) WAIT WINDOW "Press any key to hang up" s = "ATH0" + chr(13) =CALLFN(writecomm, com1, s, len(s)) =CALLFN(closecomm, com1) RELEASE LIBRARY SYS(2004)+"foxtools.fll"
hnd = RegFN("OpenComm","CCC","I","User.dll")
联系客服