Microsoft KB Archive/327362

= You may lose data unexpectedly when you debug the Input property of the MSComm control in Visual Studio .NET =

Article ID: 327362

Article Last Modified on 11/26/2007

-

APPLIES TO


 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition

-



This article was previously published under Q327362



SUMMARY
When you use the MSComm control in Microsoft Visual Studio .NET or in other development languages, you may experience unexpected loss of data while you debug the Input property of the MSComm control. The Input property is used to return and to delete buffered information.

Note The MSComm control is implemented in the MSComm32.ocx file.



MORE INFORMATION
When you debug the application that contains the MSComm control and then you break before the Input property of the MSComm control to read the buffer value with the debugger, the value in the buffer is read and is removed from the buffer. Therefore, after you step through the code that tries to read the buffer, the code will read the buffer value as NULL.

This behavior occurs because the input buffer is designed to read the buffer value only one time. This behavior does not occur when the buffer value is not read while you debug. Because the buffer is designed to be read one time only, the debugger or the program that reads the buffer first clears the data out of the buffer.

