|
-
November 16th, 1999, 12:41 AM
#1
Copy Memory
Hi,
I am using the API call CopyMemory in my code. It works fine when my source is of datatype long/int. But the program crashes when source is of any other data type like string.
Does this call accept only long data type, if yes can anybody hint me how to convert a string to long and then get this back.
------------------------------------------------------------------------
private Declare Sub CopyMemory Lib "Kernel32" Alias "RtlMoveMemory" (Destination as Any, Source as Any, byval Length as Long)
Your view on this issue will be of great help.
Cheers,
Bin.
-
November 16th, 1999, 03:36 AM
#2
Re: Copy Memory
Try with fixed length string
-
November 16th, 1999, 03:42 AM
#3
Re: Copy Memory
use the Byval keyword in your call as in:
Declare Sub CopyMemoryD Lib “KERNEL32” Alias “RtlMoveMemory” ( _ lpvDest as Any, lpvSource as Any, byval cbCopy as Long)
CopyMemoryD byval sDstD, byval sSrc, len(sSrc)
"stolen" from MSDN
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
|