Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API functions for FoxPro 5

Status
Not open for further replies.

ShyFox

Programmer
Mar 22, 2003
210
ES
Hy
I found out that VFP 7.0 can use a API functions. Who can tell me where can I find a program that could give me the Fox syntax to call API functions (there's a program that I encountered for Visual Basic, I forgot it's name). I know about but I do not have the net full time at work.
Thank you.
Regards.
 
ShyFox

I found out that VFP 7.0 can use a API functions.

API calls in VFP go back to at least FoxPro 2.6 as far as I can remember.

Who can tell me where can I find a program that could give me the Fox syntax to call API functions

As far as I know there is no such program, you either know both VB and VFP and you understand how to translate between the two, or some one else does. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Shyfox,

If you look at the solutions example that came with VFP, you will find some examples. For example, if you want to read/write an ini file, you can use:

declare integer GetPrivateProfileString in Win32API ; string cSection, string cKey, string cDefault,; string @cBuffer, ;
integer nBufferSize, string cINIFile

and

declare integer WritePrivateProfileString in Win32API ;
string cSection, string cKey, string cValue,; string cINIFile

Then use use this in your code as you would any function.

The only trick is learning what data types to use when defining them since often, the data type information you get uses the C variable types.

Take care,

Fletcher
 
Also check out the UT's ( API section.

I've had a copy of Dan Appleman's "Visual Basic Programmer's Guide to the Win32 API" around for a long time. It covers many of the "important" API calls and has lots of sample code. It's not that tough to convert most of them to VFP.

Rick
 
mgagnon (Programmer) Mar 24, 2003

"API calls in VFP go back to at least FoxPro 2.6 as far as I can remember."

I use FoxPro for 2 years, my language is C++, so I didn't know to much of it. But thank you for telling me that. It's a think that it's good to know.
Thak you all for your help !
Regards.
 
For a comprehensive list of API functions, see the MSDN Library program. The syntax isn't VFP, but it is complete, and learning to translate to VFP is very useful knowledge.
 
Just a note:
"API calls in VFP go back to at least FoxPro 2.6 as far as I can remember."

I am using them with Fox Win 2.5...... [smile]
Dave S.
[cheers]
 
Dave

I am using them with Fox Win 2.5......

Then obviously my memory does not go that far back. ;-)
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top