|
OpenComm() 是可以使用 FOXTOOLS 呼叫的函式。若要開啟 COM 或 LPT 連接埠 FLL。下面是 OpenComm() 的完整說明。
用途
OpenComm() 函式會開啟通訊裝置。
函式語法 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.
註解Windows 允許 COM 連接埠 1 到 9 及 LPT 連接埠 1 到 3。如果裝置驅(qū)動程式不支援通訊連接埠號碼,將會失敗的 OpenComm() 函式。範例程式碼下列程式碼範例會使用 OpenComm() 函式和 FOXTOOLS。若要開啟 COM1 的 FLL。(本範例可以在 FOXPROW\GOODIES\FOXTOOLS\DIALER 中找到。PRG。) |
|
|
來自: Alkaid2015 > 《75.VFP狐仙◆》