Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help speed binary field conversion
Message
De
26/08/2005 13:28:47
 
 
À
26/08/2005 12:17:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 7
Divers
Thread ID:
01043345
Message ID:
01044377
Vues:
15
Hello,

i don't know of a free C IDE that can create FLL's. The problem lies in the fact that FLL functions use the _fastcall calling convention, which is microsoft specific and which none free IDE i know of supports.
Borland C++ Builder also supports the _fastcall calling convention, but Borland _fastcall is not binary compatible with MS's one.

With a normal DLL it would also work, but the function definition and the code has to be restructured, cause one cannot return binary data easily to FoxPro from C like in an FLL.

the function definition of the normal DLL version would look like:

void _stdcall SomeName(char *pInput, int nInputLen, char *pOutput, int *nOutputLen)
{
&& conversion code here..
}

which is DECLARED in FoxPro:
DECLARE SomeName IN some.dll STRING, INTEGER, STRING @, INTEGER @

and one needs a wrapper like this to call it ..
FUNCTION ToBinary(lcString)
LOCAL lcBuffer, lnLen, lnInputLen
lnLen = 0
lnInputLen = LEN(lcString)
lcBuffer = SPACE(lnInputLen)
SomeName(lcString,lnInputLen,@lcBuffer,@lnLen)
RETURN LEFT(lcBuffer,lnLen)
ENDFUNC

if you're not that comfortable with C, i could also create the FLL for you,
if you want? I'm currently unemployed and i have more than enough time and i wouldn't need more than half an hour anyway.

As another option I could include the function inside my freeware FLL i'm currently developing.

Regards
Christian
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform