BUG: VBCE: Unable to Send an Array Using the MSCEComm Control (271302)
The information in this article applies to:
- Microsoft eMbedded Visual Basic 3.0
- Microsoft Windows CE Toolkit for Visual Basic 6.0
This article was previously published under Q271302 SYMPTOMS
In a Windows CE Toolkit for Visual Basic (VBCE) 6.0 or an eMbedded Visual Basic (eVB) 3.0 project that uses the MSCEComm control, when you attempt to send an array from the device, the data is not transmitted and there are no errors.
RESOLUTION
To work around this problem, add the following code to Form1 in the Visual Basic for CE sample that is shown in the "Steps to Reproduce Behavior" section:
Declare Function WriteFileL Lib "Coredll" Alias "WriteFile" _
(ByVal hFile As Long, lpBuffer As Byte, ByVal nNumberOfBytesToWrite As Long, _
lpNumberOfBytesWritten As Long, ByVal lpOverlapped As Long) As Long
Public Sub SendArrayData(ByVal hCommID As Long, baData)
Dim i, lRet, iWrite
For i = LBound(baData) To UBound(baData)
lRet = WriteFileL(hCommID, baData(i), 1, iWrite, 0)
Next
End Sub
Next replace the Command2_Click event code, in the same project, with the following:
Private Sub Command2_Click()
Dim bTemp(29) As Byte, y As Integer
For y = 0 To 29
bTemp(y) = y
Next y
SendArrayData Comm1.CommID, bTemp
End Sub
When you run both of these projects and select Receive Array, you should see that when you click Send Array, the textbox displays the numbers 0 through 29.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 8/19/2005 |
---|
Keywords: | kbbug kbpending KB271302 |
---|
|