Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling c++ dll passing arrays by reference
Message
From
12/11/1996 15:57:48
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00012057
Message ID:
00012072
Views:
36
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform