ye....
you got the question in Subject..
Printable View
ye....
you got the question in Subject..
If it's a byte array, you can convert the array to string with StrConv function, if it's an array of any other type, you can calculate the total ammount of memory in bytes, then with CopyMemory API, you can copy the memory to a byte array, and then conver to string.
Obviously when you receive the data, you have to do the reverse...
Well i dont fully understand your question, you are a little vague but if you mean sending every string in an array with delimiters then:
VB Code:
For i = 0 to UBound(ArrayName) Winsock1.SendData ArrayName(i) & "DELIMITER" DoEvents Next i
Hope that helps
you should be able to just send the array through, like
VB Code:
dim arr(2) as string arr(0) = "hi" arr(1)="hello" arr(2)="bye" winsock1.senddata arr
and in the recieve part,
VB Code:
dim arr() as string winsock1.getdata arr,vbarray
of course I could be wrong.
the best way to do it would be to uses a dilemiter, if you are unsure of what these are theres a tuturiol on
www.winsockvb.com
basicly you loop through the array sending each 'bit' then on the other end recieve it and split the data up (this is also shown on winsockvb.com!)
if you need any more guidence on this topic please post back i'd be happy to fully explain it to you
PINO-
You could use Join ;)
Ah I love C++ with its crazy pointer typecasting :p Makes life so simple. "send(sockt, (char*)anythingYouWant, itsLengthInBytes, 0);" :cool:
WE DON'T CARE. This is a VB forum. NOT C++ forum. We are trying to find solutions in VB. Unless it is impossible to do in VB, don't tell us about how C++ is better.Quote:
Originally posted by HunterGuy2
Ah I love C++ with its crazy pointer typecasting :p Makes life so simple.
Well.... but if I turn a bit.....
How do the XML stuff work???
Should I send the xml as a file....then how do I open it in VB??
FWIW, the Winsock control can pass byte arrays. There is no need to convert to and from a string.Quote:
Originally posted by CVMichael
If it's a byte array, you can convert the array to string with StrConv function, if it's an array of any other type, you can calculate the total ammount of memory in bytes, then with CopyMemory API, you can copy the memory to a byte array, and then conver to string.
Obviously when you receive the data, you have to do the reverse...
Sorry. *sticks hand in a bucket of icewater, hoping it won't need to be amputated* :rolleyes:Quote:
WE DON'T CARE. This is a VB forum. NOT C++ forum. We are trying to find solutions in VB. Unless it is impossible to do in VB, don't tell us about how C++ is better.