iskitua
asked on
CopyMemory and Win2000
I am calling the CopyMemory function. In 95 this code works just fne. I move it to Win2000 and as soon as it hits this function it dies. any ideas?
CopyMemory sGrpRc, TGrpIdStrct, Len(TGrpIdStrct)
Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" ( _
ByVal hpvDest As String, hpvSource As Any, ByVal cbCopy As Long)
thanks
CopyMemory sGrpRc, TGrpIdStrct, Len(TGrpIdStrct)
Declare Sub CopyMemory Lib "KERNEL32" Alias "RtlMoveMemory" ( _
ByVal hpvDest As String, hpvSource As Any, ByVal cbCopy As Long)
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried as Any. Still the same results.
Found if I set the sGrpRc = Space(Len(TGrpIdStrct))
it works.
Found if I set the sGrpRc = Space(Len(TGrpIdStrct))
it works.
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Note the As Any on the destination. You are limiting to string.