|
-
May 6th, 2007, 03:50 PM
#12
Re: [HELP NEEDED] Socket + UDT + CopyMemory...
Strings are UTF-16/BSTR and hold 2 bytes per character, but when using API calls, such as CopyMemory, VB automatically converts the contents of the string (and in this case the whole UDT) into ANSI, so String * 16 actually is 16 bytes. Then the returning String / UDT is then converted back into the format VB actually uses, so you have 32 bytes, but 16 characters.
This also happens when saving/loading text files with Strings.
This doesn't happen if a pointer is passed instead of the string or UDT, however, there are other things that must be noticed: because these are out of the actual topic in this thread, I leave them out.
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
|