Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Arrays & APIs
Message
 
 
To
12/04/2003 20:24:01
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00776993
Message ID:
00776996
Views:
12
>Hi all,
>
>Is this possible in VFP? I am not sure if this is valid or not. The API function did not update the array elements.
>
>
>declare long APIGetEnv in APIDll long
>declare long APIFunction in APIDll long pPointer, double @ dArray
>dimension dArray[2]
>dArray=0.0
>nPtr=APIGetEnv()
>nError=APIFunction(nPtr,@dArray) && does not update the array elements!!!
>* function returns nError <> 0 which means success.
>
>
>I checked out the samples in VFP8 on passing arrays to API which converts the array to a string of Hex representations of the arrays. I need to pass the array to be updated with values.

Ramil,

Samples are correct. You've to build string of array items and pass it to DLL. After call to DLL you've to convert items back from string using Re: How to read a 32bit float from disk Message #569663 or DoubleToNum() function from Heap allocation class File #9482.
declare long APIGetEnv in APIDll long
declare long APIFunction in APIDll long pPointer, string @ 
lcArray = REPLICATE(CHR(0), 8*2)
nPtr=APIGetEnv()
nError=APIFunction(nPtr, @lcArray)
DIMENSION dArray[2]
dArray[1] = bton(SUBSTR(lcArray,1,8) 
dArray[2] = bton(SUBSTR(lcArray,9,8))
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform