Results 1 to 7 of 7

Thread: array and user-defined-types

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    58

    array and user-defined-types

    I have 2 problems, and if you combine them 3. :P


    1. How do I send a(n) (three-dimensional) array with winsock?
    2. How do I send a user-defined-type with winsock?
    3. How do I send an array of a user-defined-type with winsock?

  2. #2

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    58

    Re: array and user-defined-types

    Anyone?

  3. #3
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: array and user-defined-types

    I'm not sure you can.

    I remember seeing code for sending objects over Winsock but I forgot where I found it, somewhere on www.pscode.com/vb

    You could try declaring it as a variant and then sending the variant variable but I'm not sure that will work.

    Or putting the UDT array into a file, and then reading that file back into a byte array and sending the byte array. But I would only use that if you can't find any other method.

    VB Code:
    1. Dim intFF As Integer
    2.  
    3. intFF = FreeFile
    4.  
    5. Open App.Path & "\temp.bin" For Binary Access Write As #intFF
    6.     Put #intFF, 1, MyUDTArray()
    7. Close #intFF
    8.  
    9. intFF = FreeFile
    10.  
    11. Dim bytData() As Byte
    12.  
    13. Open App.Path & "\temp.bin" For Binary Access Read As #intFF
    14.     Get #intFF, 1, bytData()
    15. Close #intFF
    16.  
    17. Winsock.SendData bytData()

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    58

    Re: array and user-defined-types

    I read something about copymemory/rtlmovememory being able to flatten arrays, but I can't do it...

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    58

    Re: array and user-defined-types

    Hello?

  6. #6

  7. #7

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    58

    Re: array and user-defined-types

    Thnx, I know that now...
    Question 1 and 3 left. :P

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