Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pass Array of Doubles to WinAPI routine
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00854213
Message ID:
00854496
Views:
15
Since VFP will do the necessary conversions to pass binary scalars to API routines, could you just multiply declare RtlMoveMemory with several aliases using VFP's DECLARE command, and have a different "aliased" version for each data type that you wanted to move somewhere? Like this:

DECLARE INTEGER RTLMoveMEmory IN win32API as VFPMoveDouble Double xSource, String @xDest, nBytes

DECLARE INTEGER RTLMoveMEmory IN win32API as VFPMoveFloat32 Single xSource, String @xDest, nBytes

So to move a Double:
xSource=3.141592
cTarget=Repl(" ",8)
VFPMoveDouble(xSource, @cTarget, 8)
And to move it as a single-precision float:
cTarget=Repl(" ",4)
VFPMoveFloat32(xSource, @cTarget, 4)
>Check this link:
>http://fox.wikis.com/wc.dll?Wiki~VFPFloatingPointDataType~VFP
>
>Link doubles together to a string buffer, or allocate memory and fill it with doubles. Depends on how is the external function declared.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform