FIX: Setting InBufferCount Property Generates Error |
Q187542
The information in this article applies to:
- Microsoft Windows CE Toolkit for Visual Basic 5.0
SYMPTOMS
When you attempt to set the InBufferCount property of the MSCEComm control in Windows CE Toolkit for Visual Basic 5.0 (VBCE), the following error message appears:
450 "Wrong number of arguments or invalid property assignment."
CAUSE
The InBufferCount property is read-only in Windows CE Toolkit for Visual Basic 5.0. The standard Comm control that ships with Visual Basic allows the programmer to set the InBufferCount to zero to empty the input buffer.
RESOLUTION
To clear the input buffer, simply call the MSCEComm control's Input method, which will read and clear the input buffer as shown in the following code:
Private Sub cmdClearBuffer_Click() On Error Resume Next Dim clear clear = Comm1.Input If Err.Number <> 0 Then MsgBox Err.Description End Sub
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Windows CE Toolkit for Visual Basic 6.0.
MORE INFORMATION
Steps to Reproduce Behavior
- Start a new Windows CE project in Visual Basic 5.0. Form1 is created by default.
- Add a CommandButton (Command1) to Form1.
- Use the Control Manager to install and register the MSCEComm control in emulation. For more information, see the REFERENCES section of this article.
- Select Components from the Project menu, and then select the Microsoft CE Comm Control 1.0.
- Add a MSCEComm control (Comm1) to Form1.
- Add the following code to the Command1 Click Event:
- Run the project and click the CommandButton.
REFERENCES
For additional information, please see the following article in the Microsoft Knowledge Base:
Q185204 HOWTO: Use the Control Manager in CE Toolkit for Visual Basic
Additional query words: wce wince vbce vbce5 vbce6
Keywords : kbToolkit kbVBp500 kbVBp600fix kbOSWinCE100 kbGrpDSVB
Issue type : kbbug
Technology : kbVBSearch kbAudDeveloper kbWinCETKVBSearch kbWinCESearch
Last Reviewed: July 15, 1999 |