Pass variables through network connection

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2006
Posts: 119
Reputation: agrothe is an unknown quantity at this point 
Solved Threads: 14
agrothe's Avatar
agrothe agrothe is offline Offline
Junior Poster

Pass variables through network connection

 
0
  #1
Jul 16th, 2006
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?
------------------------------------------------------------
If you see no coffee in my immediate vicinity, speak slowly and use small words....
ConnectNL Directory | Blog
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Pass variables through network connection

 
0
  #2
Jul 16th, 2006
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1486 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC