|
-
September 24th, 1999, 07:43 AM
#1
Unpacking mixed unicode and byte data
My VB app receives a Winsock msg from an OS/2 machine, containing 8 bytes of binary data and a 100 byte message. I can convert the character data to unicode with Strconv, but I can't seem to unload the return code bytes into any VB data type. Code fragment:
' get the socket message
WinsockClient.GetData strData
' Convert and unpack the message header
uniString = StrConv(strData, vbUnicode)
string = mid(uniString, 9, 100) ' An ascii msg, converts fine
integer = mid(uniString, 1, 1) ' doesn't work, before or after Unicode conversion
Any suggestions?
Thanks
-
September 25th, 1999, 12:15 AM
#2
Re: Unpacking mixed unicode and byte data
Use Asc or AscW as the case may be
Dim i as integer
i = AscW(mid$(uniString, 1, 1))
RK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|