Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Parameters to FLL Problem
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Passing Parameters to FLL Problem
Miscellaneous
Thread ID:
00583705
Message ID:
00583705
Views:
64
I have been playing around with the Library Construction Kit and have built my first FLLs. I have been able to do some very interesting stuff with it, but I am having trouble with passing parameters.

Using the following code, the "ThisValue( )" function always returns .T.:
	/* 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.

Anyone have any ideas?

Thanks,
Bo Durban
Next
Reply
Map
View

Click here to load this message in the networking platform