Results 1 to 6 of 6

Thread: Winsock? Winsuck!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350
    I have a little problem using Winsock. I am using it to send a keystrokes - a single bytes representing ASCII codes. When you are typing (very) slowly, it works. But when you type more quickly, the I have troubles on client (maybe) side - the characters are higgledy-piggledy sorted, sometimes the whole groups of characters.


    I tried to use something like this:

    Code:
     Sub Winsock1_DataArrival....
      Winsock1.GetData d, vbArray+vbByte
      Do While Recieving
       Doevents
      Loop
    
      Recieving = True
      ...
      Recieving = False

    But this doesn't helped. How to get the right order, even they are quickly sent?

  2. #2
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    try this

    comp 1

    text1_keypress(keyascii as integer)
    sock.senddata str(keyascii)
    end sub


    comp 2

    sock_dataarrival

    sock.getdata strIn

    sendkeys strIn
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350
    Yeh, I though about this, but I need to send a virtual keys too...

  4. #4
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    Why not make up your own protocol


    $K=Press the space


    etc
    Kurt Simons
    [I know I'm a hack but my clients don't!]

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350
    The protocol is good idea. It works well; but...
    I tried to send the keys as strings - no change, the some letters are on ohter place than yhte should be.

  6. #6
    Addicted Member
    Join Date
    Jul 1999
    Location
    St-Élie d'Orford, Quebec, Canada
    Posts
    133
    Hi,

    Your caracters are sorted in the wrong order because of your DOEVENT... What I think is that the event is trigged a couple times and some of them are processed in the doevent inside the first event.

    Try it without the doevent...
    What is the scope of "D", global probably.
    Also I can see you are using arrays of bytes...the best way to use getdata is with a string datatype.

    The general idea is that the getdata only contains something like this :

    winsock sub
    dim sTemp as string

    getdata sTemp
    d = d & sTemp
    end sub

    AND you in a timer or something like this process the "d" variable

    E-mail me if you want more info on this I think I got it pretty clear in my mind.

    P.S. I've used Winsocks a lot and I'am convinced it should be spelled Winsuck as well as it's creator Microsucks :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width