title: Serial Communication in VB6
body: <p>I am new with vb6 and communication app, I try to run a example that transmitting  and receiving data between two serial ports ( I install two serial ports by <strong>com0com</strong> soft). </p>
  
  <p>In this example, I want User to type charracters in textbox1, then click command button, and charracters in textbox1 display in textbox2. </p>
  
  <pre><code>Private Sub Command1_Click()
  com1.Output = Text1.Text
  End Sub
  
  Private Sub Form_Load()
  com1.CommPort = 1
  com1.Settings = "9600,n,8,1"
  com1.PortOpen = True
  com2.CommPort = 2
  com2.Settings = "9600,n,8,1"
  com2.PortOpen = True
  
  Text1.Text = ""
  Text2.Text = ""
  End Sub
  
  Private Sub com2_OnComm()
  If com2.CommEvent = comEvReceive Then
      Text2.Text = Text2.Text + com2.Input
  
  End If
  End Sub
  </code></pre>
  
  <p>I screened <code>form</code> in the example and setting in com0com port, I don't have enought reputation to post image, so I upload this to flickr. </p>
  
  <p><a href="http://farm8.staticflickr.com/7627/16740707238_6b1d9ec3ab_b.jpg" rel="nofollow">http://farm8.staticflickr.com/7627/16740707238_6b1d9ec3ab_b.jpg</a></p>
  
  <p>But when I try to run this example by type charracters in textbox1 and click button, nothing happen. </p>
  
  <p>So what am I doing wrong?. If so, how can I do to get data from com1 port to com2port? Or any advice for anything!</p>
  
  <p>thanks for reading !</p>