Microsoft KB Archive/152778

= Example Shows How to Pass Objects to FLL =

Article ID: 152778

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q152778



SUMMARY
Visual FoxPro provides eight new API routines that allow you to manipulate Visual FoxPro objects and controls. In addition, the Value structure defined in the Library Construction Kit (LCK) has been expanded to use object references. This article gives an example showing how to pass and receive object references within an LCK routine.



MORE INFORMATION
The following C code illustrates how to use one of the new API routines, which requires an object reference (_WGetObjectClientWindow) and returns a handle to the window containing the passed object. The LCK routine clears the command button from the window to verify that the program is working as expected.

FoxPro Code
* Place the following code in the Click event of a button on a form: SET LIBRARY TO clearwind.FLL ADDITIVE = CLEARWIND(this) && we are passing the button object to the C routine RELEASE LIBRARY clearwind

C Code

 * 1) include 

void FAR ClearObjWin(ParamBlk FAR *parm) {  WHANDLE Wh; \\ Note that you are passing the address to the Value structure. Wh = _WGetObjectClientWindow(&parm->p[0].val); _WClear(Wh); };

\\ Note below that the parameter type is "O" (for Object). FoxInfo myFoxInfo[] = {  {"CLEARWIND", (FPFI) ClearObjWin, 1, "O"}, };

FoxTable _FoxTable = {  (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo };

