Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to access a comport interrupt using vb

Status
Not open for further replies.

coverdale

Technical User
Mar 11, 2000
5
CA
I'm trying to have a program that only execute when there is something  comeing in on the comport. I hopeing that there is a comport interrupt i can access. I don't want to poll for the comport because this take up systems resources.IF anyone has some sample code it would be greatly appreciate.
 
coverdale,<br>You're in luck..the MSComm control has an OnComm event, which will do what you need.&nbsp;&nbsp;A simple example would be:<br>Private Sub MSComm1_OnComm()<br>dim myvar as string<br>If me!mscomm1.commevt = 2 then '2 = recieve<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myvar = mscomm1.input<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msgbox myvar & &quot; just arrived in at Com &quot; & me!mscomm1.commport & &quot;!&quot;<br>End If<br>--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top