Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Memory objects saved into cursors
Message
From
20/02/2019 10:23:59
 
 
To
20/02/2019 09:57:02
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01666501
Message ID:
01666581
Views:
58
>>Also certain that there are probably more more than 2 handful of people with knowledge of those structures: first all the people at MS hacking at the C(++) sources, besides Calvin was Alexey T. who informed me once that one of the bugs I had reported was a wrong type cast in C code, and probably a few others. In Userland besides Chen is Christoph Lange, who knows much more about internal working of vfp compared to me, and most devs creating Flls have some knowledge about vfp variable structures just by reading comments in the sources...
>
>Dang... I had a book (which came with another bunch of books and some 17 floppies in the FP2.5 package) with instructions on how to write fll (though it was called differently then), and it had the memory structures laid out. A VFP variable has some 16 bytes descriptor block, where only the first two integers (32 bit, of course) are pointer and length. The rest describe type and few other things. Dom't ask me how much more I remember, it's very little.

It's explained how to do it in the samples\API\examples.dbf file.

Attached is an FLL with the reverse.c code in that samples\API\ folder modified somewhat, loaded into a Visual Studio 2008 solution file, that can be loaded and used as a template.

To create an FLL, populate the FoxInfo with four fields, the name of the function, a pointer to the code to run when that command is used in VFP, the number of input parameters, and (I believe) the return type.
FoxInfo myFoxInfo[] =
{
	{"REVERSE",		(FPFI)reverse,		1, "C"},
};
To create an FLL, compile it as a DLL and rename it to FLL. There is a post-build step in this Visual Studio solution that does that. It will copy it from copy $(TargetPath) to c:\temp\test\test1.fll, which can then be used in code like this:
SET LIBRARY TO test1.fll
? reverse("test")
If anyone needs help writing an FLL I can help you.
Previous
Reply
Map
View

Click here to load this message in the networking platform