by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 17th January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Copy a string to another variable using lstrcpy API
' Copy the source string to the target string
Dim source As String, target As String ' the two strings
Dim retval As Long ' return value
source = "Mission Impossible" ' the source string to copy
target = Space(Len(source))
retval = lstrcpy(target, source) ' set target to equal source
MsgBox "Source string = " & source
MsgBox "Target string = " & target
End
End Sub