>Declare second parameter as a string passed by reference. This'll pass pointer to the string into function. Anyway it's not a good idea to keep a pointer to VFP memory variable because VFP could change string location in memory when it's doing internal "garbage collection".
DECLARE RtlMoveMemory IN kernel32 As CopyMemory;
> STRING @ Destination,;
> <b>String @ Source, </b>;
> INTEGER nLength
>lpBuffer = SPACE(100)
>lcTemp = Getenv("temp")
>= CopyMemory (@lpBuffer, @lcTemp, Len(lpBuffer))
Take a look at file#
986and file#
9557 for some related info.
Sergey,
Many thanks for the info. I thought if the WinApi description or the function contains for the second parameter
int
, I am forced to declare it Integer, but it seem I am wrong. Now I understand what's happening there: it doesn't matter what type I declare if I send the correct parameter to the Api function.
Thank you again. The solution you gave works.
Three stars here :)
Grigore Dolghin
Class Software.