/* c++ code... *****************/ #include <pro_ext.h> void ThisValue(ParamBlk *parm) { //_BreakPoint(); _RetVal(&parm->p[0].val); } FoxInfo myFoxInfo[] = { {"THISVALUE", (FPFI) ThisValue, 1, "?"}, }; extern "C" { FoxTable _FoxTable = { (FoxTable FAR *) 0, sizeof(myFoxInfo) / sizeof(FoxInfo), myFoxInfo }; } /* end c++ code ****************/ ** Fox code... ***************** set library to "sample.dll" ?ThisValue(123) ?ThisValue("Hello") ?ThisValue(.T.) ?ThisValue(DATE()) ?ThisValue(DATETIME()) ?ThisValue($500.00) ?ThisValue(_vfp) set library to wait ** end Fox code ****************When I run the C++ debugger, the "parm" parameter looks like garbage:
parm->pCount = 1769 parm->p[0].val.ev_type = 0 '' parm->p[0].val.ev_padding = 0 '' parm->p[0].val.ev_width = -13312 parm->p[0].val.ev_length = 3435973836 ...I tried changing this line several different ways but it always returns the same results:
{"THISVALUE", (FPFI) ThisValue, 1, "?"}, {"THISVALUE", (FPFI) ThisValue, 1, "C"}, {"THISVALUE", (FPFI) ThisValue, 1, "N"}, {"THISVALUE", (FPFI) ThisValue, 1, "R"}, {"THISVALUE", (FPFI) ThisValue, 3, "???"},I have tried the VFP5, VFP6, and VFP7 api library files, but I'm getting the same results. I'm guessing I don't have something set up correctly in the c++ project but I am not sure. I'm using VC++ 6.0 and all the LCK help appears to be for another version of C++ when explaining how to set up a new project.