|
-
Feb 10th, 2011, 06:58 AM
#15
Re: [RESOLVED] Avoiding Memory Leaks - CopyMemory
I am getting a little out of touch but, I assume you both know that when passing strings to API, VB makes a temporary ANSI copy of the string and passes the temporary copy instead. By passing the first element ByRef VB knows you are passing a reference to something which contains a string so it makes a temporary ANSI copy of the first element (and just the first element) and passes that. Hence apparent garbage. If you followed that string pointer I bet you find an ANSI string.
The moral of the story should perhaps be, be careful with ByRef strings and API.
Last edited by Milk; Feb 10th, 2011 at 08:50 AM.
Reason: went a bit comma crazy
W o t . S i g
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
|