Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass Array of Doubles to WinAPI routine
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00854213
Message ID:
00854496
Vues:
14
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform