Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling c++ dll passing arrays by reference
Message
De
12/11/1996 15:57:48
 
 
À
12/11/1996 15:20:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00012057
Message ID:
00012072
Vues:
37
>thanks edward,
>okay with passing a single value by reference, but what i need to do is pass in an array, such as an array of floats.
>
>Here's the C++ declaration:
>DLL_FUNCTION int ShapeVerifyEntryPoint( char *shapeId, int numDims, float dims[MAX_DIM] )
>
>
>Here's my fox code:
>DECLARE INTEGER ShapeVerifyEntryPoint IN shapedll.dll AS ShapeVerify STRING @shapeid, INTEGER numdims, DOUBLE[10] the_dims
>
>#DEFINE MAX_DIMS 10
>
>LOCAL lcShapeID, lnNumDims, laDims, lnReturn
>
>lcShapeID = "52"
>lnNumDims = 1
>DIMENSION laDims[lnNumDims]
>laDims[1] = 20.0
>
>lnReturn = ShapeVerify(lcShapeID, lnNumDims, laDims)
>
>RETURN
>
>The results of running this is that FoxPro bombs.

passing an array of floats is a little complicated
asz you need to translate each float into its presentation and pass it all in a string
there is an example of passing an array of integers in the solution app that ships with VFP5.0

Arnon
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform