Application notes
Version 8 dated 15.03.00
180
Siemens Information and Communication Products
8.4.2.3
int CloseComm(idComDev)
int idComDev;
/* device to close
*/
The CloseComm function closes the specified communications device and frees any memory allocated for the device’s
transmission and receiving queues. All characters in the output queue are sent before the communications device is closed.
8.4.2.4
BOOL EnableCommNotification(idComDev, hwnd, cbWriteNotify, cbOutQueue)
int idComDev;
/* communications device identifier
*/
HWND hwnd;
/* handle of window receiving messages*/
int cbWriteNotify;
/* number of bytes written before notification*/
int cbOutQueue;
/* minimum number of bytes in output queue*/
The EnableCommNotification function enables or disables WM_COMMNOTIFY message posting to the given window.
int CloseComm(idComDev)
Parameter
Description
idComDev
Specifies the device to be closed. The OpenComm function returns this value.
Return value
0 if the function is successful
Otherwise –1.
Example
None
Comments
None
See also
OpenComm
BOOL EnableCommNotification(idComDev, hwnd, cbWriteNotify, cbOutQueue)
Parameter
Description
idComDev
Specifies the communications device that is posting notification messages to the window identified
by the hwnd parameter. The OpenComm function returns the value for the idComDev parameter.
hwnd
Identifies the window whose WM_COMMNOTIFY message posting will be enabled or disabled.
If this parameter is NULL, EnableCommNotification disables message posting to the current win-
dow.
cbWriteNotify
Indicates the number of bytes the COM driver must write to the application's input queue before
sending a notification message. The message signals the application to read information from the
input queue.
cbOutQueue
Indicates the minimum number of bytes in the output queue. When the number of bytes in the out-
put queue falls below this number, the COM driver sends the application a notification message,
signalling it to write information to the output queue
Return value
0 indicates:
– an invalid COM port identifier
– a port that is not open or
– a function not supported by COMM.DR
≠
0 function is successful
Example
None