|
-
Oct 22nd, 2001, 10:59 AM
#1
Thread Starter
Fanatic Member
CopyMemory with StrPtr
Hi,
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Private Declare Sub ZeroMemory Lib "kernel32.dll" Alias "RtlZeroMemory" (Destination As Any, ByVal Length As Long)
Private Sub Command1_Click()
Dim strString As String * 10
Dim myStr As String * 10
ZeroMemory strString, 10
ZeroMemory myStr, 10
strString = "A_Word"
CopyMemory ByVal myStr, ByVal StrPtr(strString), 10
MsgBox myStr
End Sub
mystr only contains the letter 'A', how can i copy the rest of it?
And i HAVE to copy the string from its memory location, note the ByVal StrPtr(strString)
it works fine without the StrPtr but then it wont be know good to me then.
What it is, i have a DLL that returns the address of a string that is 10 bytes long. I would like to know what is at that address (string wise)
Thanks
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
|