Solved

GetData or PeekData and calling a form to display

Posted on 1997-11-04
3
650 Views
Last Modified: 2010-08-05
I have a program that captures data out of the comm port. I also can TELNET to the device  but when I try and invoke the peekData or GetData It see's nothing. I am using another form to display the data back, Could that be the issue? Here is the code out of the books online of the GetData I am using. Is there any good examples of TCP/IP (telnet)programs out there?
 
Private Sub Winsock1_DataArrival_(ByVal bytesTotal As Long)
    Dim strData As String
    Winsock1.GetData strData
    Text1.Text = strData
End Sub

Here is how it is being called.

Private Sub mnuTelnetOpen_Click()
   
   'Winsock1.RemoteHost = "140.248.152.196"
    Winsock1.RemotePort = 23
    'txtTerm.Text = ""
    Winsock1.Connect
    TCPform.Show vbModal
End Sub

Private Sub Winsock1_Connect()
 Dim PauseTime, Start, Finish, TotalTime
 Dim error1, last1
 
    Winsock1.SendData "root" & Chr(13)
    Beep
    Winsock1.SendData Chr(13)
    Winsock1.SendData Chr(13)
    'MSComm1.InputLen = 0 ' Get all available data
    'MSComm1.Handshaking = 1
     
   
       
     If MSComm1.PortOpen = True Then
     
        Winsock1.SendData "ls" & Chr(13)

Thanks in advance for your help.

-S
0
Comment
Question by:smurray
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 100 total points
ID: 1439800
smurray,

When you open a form modally, you stop all processing on the calling form until you return from the modal form.  Therefore, you are not getting your events.  You need to not show the form modally, and some how create a "pseudo-modal" form.  By that I  mean, it's operates like a modal form, but is not really modal.

Anthony
0
 

Author Comment

by:smurray
ID: 1439801
Thanks for the tip on the modalm but I still cannot read back from the device. Is there an example on how to GetData during a Telnet session?
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1439802
what you did looks perfect   I have a telnet OCX of my own, and that's how I made it.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question