Link to home
Start Free TrialLog in
Avatar of iskitua
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
ASKER CERTIFIED SOLUTION
Avatar of KillerApp
KillerApp

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of twalgrave
twalgrave

Here's my API definition for that function:

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.


Avatar of iskitua

ASKER

I tried as Any.  Still the same results.
Found if I set the sGrpRc = Space(Len(TGrpIdStrct))
it works.