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

Article translations Article translations
Article ID: 327362 - View products that this article applies to.
This article was previously published under Q327362
Expand all | Collapse all

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.

REFERENCES

For additional information, visit the following Microsoft Developer Network (MSDN) Web sites:
Using the Communications Control
http://msdn.microsoft.com/en-us/library/aa231237(VS.60).aspx

Properties

Article ID: 327362 - Last Review: November 26, 2007 - Revision: 1.4
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
Keywords: 
kbvs2005swept kbvs2005doesnotapply kbhowto kbinput kbctrl kbproperties kbdebug kbinfo KB327362

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com