Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing arrays to dlls
Message
De
31/10/2002 09:25:12
 
 
À
31/10/2002 09:03:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00717285
Message ID:
00717298
Vues:
15
>Can't quite get my head around this one.
>
>I'm having trouble using a DLL. The simple functions I can handle, but when it comes to arrays........
>
>Documentation (VB I guess) says:
>Declaration:
>long IORead {long numChannels,
> long *channelIDs,
> float (*input)[4],
> long *state }
>
>where:
>channelIDs is an array of integers (0,1,2,3)
>input is a pointer to a 4096 x 4 array
>and state is a pointer to a 4096 element array
>
>I’ve tried:
>
>DECLARE long IORead IN SomeDLL.dll ;
> long numChannels, ;
> string *channelIDs, ;
> string *input, ;
> string *state

Change the Definition to:

DECLARE long IORead IN SomeDLL.dll ;
long numChannels, ;
INTEGER @ channelIDs, ;
string @ input, ;
string @ state


>
>numChannels = 4
>channelIDs = CREATEBINARY( ‘0123’)

change this to:

channelIDs = 0x00010203


>input = space(4096 x 4)
>state = space(4096)
>
>errorNo = UORead (;
> numChannels, ;
> *channelIDs, ;
> *input , ;
> *state ;
> )

The * prefix is incorrect, to pass by ref, use:

errorNo = UORead (;
numChannels, ;
@channelIDs, ;
@input , ;
@state ;
)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform