Example Shows How to Pass Objects to FLL

Last reviewed: June 25, 1996
Article ID: Q152778
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0b

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

#include <pro_ext.h>

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
};

REFERENCES

For more information about building FLLs for Visual FoxPro, please see the following articles in the Microsoft Knowledge Base:

   ARTICLE-ID: Q135709
   TITLE     : PRB: Visual C++ Link Error LNK2001: unresolved external
               symbol

   ARTICLE-ID: Q137059
   TITLE     : DOCERR: Missing Visual C/C++ "Multithreaded Using DLL"
               Setting


Additional reference words: 3.00b VFoxWin
KBCategory: kbtool kbcode
KBSubcategory: FxtoolLck



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 25, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.