944,038 Members | Top Members by Rank

Ad:
Jul 16th, 2006
0

Pass variables through network connection

Expand Post »
Would anyone know how, if it's possible, to pass a user defined type through a network connection say using winsock?

For example:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. type tExpl
  2. name as string
  3. address as string
  4. phone as string
  5. end type
  6.  
  7. dim myExpl as tExpl
  8.  
  9. winsock1.send myExpl

As far as i know, winsock only sends text or raw data, anyone know if this is possible?
Reputation Points: 37
Solved Threads: 18
Junior Poster
agrothe is offline Offline
151 posts
since Jun 2006
Jul 16th, 2006
0

Re: Pass variables through network connection

No. The reason is because how VB handles UDT's in Late-Bound functions.... you could in theory cast it to an object, but trying to send an object through a socket never works right. Your best bet, is to convert the UDT to a single string variable, delimited by a character sequence of your choice, and then on the other side (the server, or whatever is "recieving" the UDT) rip apart the string by the delimiter and put it back into a UDT.
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: QBASIC -> VB6 conversion
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Listbox Help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC