Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21422

WaitCommEvent Failing

$
0
0
Hi everyone,

Here is a code snippet I'm having trouble with:

Code:

    Select Case WaitCommEvent(hPort, commEvtMask, ComEvent)
        Case 0          'Error
            dwRet = Err.LastDllError
            dwRetStr = Err.Description
            Select Case dwRet
                Case ERROR_IO_PENDING
                    OpenPortTxt = "I/O is pending..."
                Case Else
                    OpenPortTxt = "Port " & PName & "Wait failed with error " & dwRet & " >> " & dwRetStr
            End Select
        Case Else      'Successful
            If (dwEvtMask Or EV_CTS Or EV_DSR) Then
                Form1.Text4.Text = serapi.RXport
                OpenPortTxt = "It worked!"
            End If
    End Select

When this function executes, it returns ERROR_IO_PENDING
I'm not sure how to fix this or even troublshoot it!
Can someone help please?

Thanks,
Ken

Viewing all articles
Browse latest Browse all 21422

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>