Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can VFPr.dll be used in 'C'
Message
General information
Forum:
Visual FoxPro
Category:
Third party products
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01509265
Message ID:
01509394
Views:
79
> It appears the 3rd link is what I want.
> I just need to understand why the following is needed.

FoxInfo myFoxInfo[] = {
{"DBAPPEND", (FPFI) Example, 1, "I"},
};
FoxTable _FoxTable = {
(FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

* * *
Hi Simon,

The first part, the FoxInfo, describes FLL's communication with the external world.
http://msdn.microsoft.com/en-us/library/cs1k587z(v=vs.80).aspx

In your example, DBAPPEND is a function visible to external programs (clients). It is to be called with a single parameter of Integer type. Such call is forwarded to Example function in your C++ code probably declared as follows.
void Example( ParamBlk *parm )
{
   //do something here...
}
Every external function has to be listed within the myFoxInfo.

The second part, the FoxTable, you will hardly need to change.
http://msdn.microsoft.com/en-us/library/a012dfat(v=vs.80).aspx

sizeof(myFoxInfo)/sizeof(FoxInfo) -- this is the number of entries in myFoxInfo.

* * *
Here's an example of these two structures declared in vfpScreenCapture.fll.
FoxInfo myFoxInfo[] = 
{
    {"SC_INIT", (FPFI) FLL_Init, (CALLONLOAD), ""},
    {"SC_DESTROY", (FPFI) FLL_Destroy, (CALLONUNLOAD), ""},
    {"SC_ABOUT",  (FPFI) About,  0, ""},
    {"SC_VERSION",  (FPFI) Version,  0, ""},
    {"SC_SETSCALE",  (FPFI) SetScale,  1, ".N"},
    {"SC_SETCAPTION",  (FPFI) SetCaption,  1, ".C"},
    {"SC_SETBORDER",  (FPFI) SetBorder,  1, "L"},
    {"SC_SETCLIP",  (FPFI) SetClipRectOn,  4, "NNNN"},
    {"SC_RESETCLIP",  (FPFI) SetClipRectOff,  0, ""},
    {"SC_SETSAFETYOFF",  (FPFI) SetSafetyOff,  0, ""},
    {"SC_SETSAFETYDEFAULT",  (FPFI) SetSafetyDefault,  0, ""},
    {"SC_SETORIGINMODE",  (FPFI) SetOriginMode,  1, "N"},
    {"SC_FINDWINDOWBYTEXT",  (FPFI) FindWindowByText,  3, "C.L.L"},
    {"SC_SETMETAPROPERTY",  (FPFI) SetMetaProperty,  2, "NC"},
    {"SC_REMOVEMETAPROPERTY",  (FPFI) RemoveMetaProperty,  1, "N"},
    {"SC_CLEARMETAPROPERTIES",  (FPFI) ClearMetaProperties,  1, "N"},
    {"SC_WINDOWTOIMAGEFILE",  (FPFI) WindowToImageFile,  2, "NC"},
    {"SC_WINDOWTOPRINTER",  (FPFI) WindowToPrinter,  2, "N.C"},
    {"SC_WINDOWTOCLIPBOARD",  (FPFI) WindowToClipboard,  1, "N"},
    {"SC_CLIPBOARDHASIMAGE",  (FPFI) ClipboardHasImage,  0, ""},
    {"SC_CLIPBOARDTOIMAGEFILE",  (FPFI) ClipboardToImageFile,  1, "C"},
    {"SC_OPENFILE",  (FPFI) OpenFileDefault,  1, "C"},
    {"SC_MOVETOFOREGROUND",  (FPFI) MoveToForeground,  1, "N"},
};

extern "C" {
	FoxTable _FoxTable = {
	   (FoxTable  *) 0,
	   sizeof( myFoxInfo) / sizeof( FoxInfo ),
	   myFoxInfo
	};
Previous
Reply
Map
View

Click here to load this message in the networking platform