Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to call any of VFP's own API functions from VFP (not C)
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
How to call any of VFP's own API functions from VFP (not C)
Divers
Thread ID:
00061661
Message ID:
00061661
Vues:
160
I wonder how many VFP programmers would be surprised to know that the VFP API functions can be called directly from VFP without the need to resort to using C/C++? I was surprised to learn this recently, because the VFP documentation seemed to imply otherwise. Also it's not obvious which of these functions would be useful or necessary when you're already in the VFP environment. If you issue the VFP command:

SET LIBRARY TO (home() + "foxtools.fll")

then you will not only have access to a bunch of mainly obsolete, unsupported FOXTOOLS functions, but also a sampling of the the real VFP API functions (which ARE supported by Microsoft and documented in the primary VFP help file). There is a separate help file for FOXTOOLS (under \VFP\TOOLS\FOXTOOLS.HLP), which begins with the disclaimer:

"...The FOXTOOLS functions are not supported by Microsoft Product Support Services (PSS) either electronically or via telephone. Many of these functions are included for backward compatibility with FoxPro version 2.6..."

This help file describes the quasi-supported FOXTOOLS functions, but makes no mention of the fact that it also gives you a way to get to certain official VFP API functions as well. Here's a sorted list of the VFP API functions that FOXTOOLS makes accessible, as excerpted from a listing generated DISPLAY STATUS:

_EDACTIVE, _EDCLOSEFI, _EDCOMMENT, _EDCOPY, _EDCUT, _EDDELETE, _EDGETCHAR, _EDGETENV, _EDGETLNUM, _EDGETLPOS, _EDGETPOS, _EDGETSTR, _EDINDENT, _EDINSERT, _EDLASTERR, _EDOPENFIL, _EDPASTE, _EDPOSINVI, _EDPROCLIST, _EDPROPERTIES, _EDREDO, _EDREVERT, _EDSELECT, _EDSENDKEY, _EDSETENV, _EDSETPOS, _EDSKIPLIN, _EDSTOPOS, _EDSTOSEL, _EDUNDO, _EDUNDOON, _FINDWINDO, _FINDWINDP, _GETWRECT, _WATTR, _WBOTTOM, _WBOTTOMP, _WCLEAR, _WCLEARREC, _WCLEARREP, _WCLOSE, _WFINDTITL, _WFOOTER, _WGETCURP, _WGETCURSO, _WGETPORT, _WHEIGHT, _WHEIGHTP, _WHIDE, _WHTOHWND, _WLEFT, _WLEFTP, _WMAINWIND, _WMOVE, _WMOVEP, _WONTOP, _WOPEN, _WOPENP, _WPOSCURP, _WPOSCURSO, _WPUTCHR, _WPUTSTR, _WRIGHT, _WRIGHTP, _WSCROLL, _WSCROLLP, _WSELECT, _WSENDBEHI, _WSETATTR, _WSETPORT, _WSETTITLE, _WSHOW, _WSIZE, _WSIZEP, _WTITLE, _WTOP, _WTOPP, _WWIDTH, _WWIDTHP, _WZOOM

Unfortunately, the preceding list doesn't include all of the standard VFP API functions. This happens to matter to me because there's one in particular, _GlobalToLocal, which I believe that I need and can't find a reasonable substitute for it. If anyone can show me how to get to this function from VFP (without a C/C++ compiler), I'd appreciate your suggestions.

I suspect that it would be easy to create a general-purpose FLL or DLL that makes ALL of the VFP API functions accessible under VFP, simply by creating a dummy C/C++ program that refers to every VFP API function. If my hunch is right, this would pull in all the entry point definitions even if the program has no real logic. It would have been nice if Microsoft included such a library with FoxPro. Maybe they did and I just don't know about it. Does anyone know if such a thing exists? If not, would someone like to volunteer to create it?

Many thanks to the people on the Universal Thread who helped acquaint me with this subject.
(I also posted this message on the newsgroup microsoft.public.fox.programmer.exchange)

Mike Asherman
mda@gis.net
Montage

"Free at last..."
Répondre
Fil
Voir

Click here to load this message in the networking platform