Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help speed binary field conversion
Message
From
26/08/2005 13:28:47
 
 
To
26/08/2005 12:17:13
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 7
Miscellaneous
Thread ID:
01043345
Message ID:
01044377
Views:
16
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform