• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 185
  • Last Modified:

VB Sending an object, or a user defined type with the winsock control

Loads of websites explain how to send text, datatypes or byte arrays using winsockControl.SendData

Files can be sent because one loads them as a byte array. However I need to know how to send a user defined type or an object created from a class file.

eg

Public Type MyTpe
mystring As String * 15
myinteger As Integer
End Type
Dim MyTypeToSend As mooType

How do I get this to work: WinsockControl.SendData MyTypeToSend

Do I need to convert MyTypeToSend into a byte array? (saving it as an intermediate file and loading that file into a byte array is too slow)

Thanks
0
adox
Asked:
adox
  • 2
1 Solution
 
adoxAuthor Commented:
Dim MyTypeToSend As *MyTpe*
Dim MyTypeToSend As *MooTpe* was a typo
0
 
adoxAuthor Commented:
I figured it out using copymemory. Problem solved!
0
 
CleanupPingCommented:
Hi adox,
This old question (QID 20555919) needs to be finalized -- no Experts commented, so delete it and get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
GPrentice00Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

-->PAQ - with points refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

GPrentice00
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now