Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does VFP7 support two aliases per API call?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00954439
Message ID:
00954441
Views:
16
Hi Anatoliy,

It works fine in VFP7SP1 and later.

>In VFP8 you can declare same API function with two aliases. The following code works in VFP8 and generates an error message in VFP6
>CLEAR
>CLEAR ALL
>
>DECLARE RtlMoveMemory IN kernel32 As MemToStr;
>	STRING @dst, INTEGER src, INTEGER nLength
>
>DECLARE RtlMoveMemory IN kernel32 As StrToMem;
>	INTEGER dst, STRING src, INTEGER nLength
>
>DECLARE INTEGER GlobalAlloc IN kernel32;
>	INTEGER wFlags, INTEGER dwBytes
>
>DECLARE INTEGER GlobalFree IN kernel32 INTEGER hMem
>
>PRIVATE hMem, cSrc, cDst, nBufsize
>cSrc="Test string"
>nBufsize = LEN(cSrc)
>hMem = GlobalAlloc(0, nBufsize)
>
>StrToMem(hMem, cSrc, nBufsize)
>
>cDst = SPACE(nBufsize)
>= MemToStr(@cDst, hMem, nBufsize)
>
>? cDst
>
>= GlobalFree(hMem)
>
>How about VFP7? If anybody could check if this code works in VFP7 that would be much appreciated. Thanks!
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform