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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comm port control

Status
Not open for further replies.

Honda

Programmer
Feb 23, 1999
10
0
0
AU
I managed to find a comm port control sample for VB3, using api calls readcomm,opencomm,closecomm, writecomm etc..<br>
<br>
What are the new api procedures for VB5,VB6 ?? Ive looked but can't seem to find any that seem to be the equivalent to these...<br>
<br>
Any help most appreciated.<br>
Thanks
 
Well in VB 4 they changes the MSCOMM <br>
so in 5 & 6 it is the same as 4<br>
If you are going to but one get VB6 it come with lots of new wizards and a FREE one year MSDN subscription. <br>
<br>
There is a sample called &quot;VBTerm.vbp&quot; in VB5 propbably in 6 too.<br>
<br>
here is a snipet (this won't run by itselt) so don't paste it in your project. But it will give you heads up of the changes. Everything is a . (dot) nowadays <br>
i.e. MSComm1.xxxxxx<br>
or <br>
MSComm1.PortOpen = True<br>
-----------------------------------------------<br>
OldPort = frmTerminal.MSComm1.CommPort<br>
NewPort = cboPort.ListIndex + 1<br>
<br>
If NewPort &lt;&gt; OldPort Then ' If the port number changes, close the old port.<br>
If frmTerminal.MSComm1.PortOpen Then<br>
frmTerminal.MSComm1.PortOpen = False<br>
ReOpen = True<br>
End If<br>
<br>
frmTerminal.MSComm1.CommPort = NewPort ' Set the new port number.<br>
<br>
If Err = 0 Then<br>
If ReOpen Then<br>
frmTerminal.MSComm1.PortOpen = True<br>
frmTerminal.mnuOpen.Checked = frmTerminal.MSComm1.PortOpen<br>
frmTerminal.mnuSendText.Enabled = frmTerminal.MSComm1.PortOpen<br>
frmTerminal.tbrToolBar.Buttons(&quot;TransmitTextFile&quot;).Enabled = frmTerminal.MSComm1.PortOpen<br>
End If<br>
End If<br>
<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
If you prefer to work with API Functions instead of VB MSComm Control,<br>
use CreateFile(), ReadFile(), WriteFile() and DCB Structure.<br>
<br>
Good Luck!<br>
<br>
Ruth Glushkin <p>Ruth Glushkin<br><a href=mailto:ruth@minicom.co.il>ruth@minicom.co.il</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top