How to call Win32 API functions in FoxPro

Source: Internet
Author: User

If we need to use the writeprivateprofilestring of the Win32 API function
For this function, we first need to declare this function in the form that calls this function.
If we want to execute it in the click function of a button, we should write it like this

* -- Define write applicationProgramDLL Functions of INI files
Declare integer writeprivateprofilestring in WIN32API as writeprivstr;
String csection, string ckey, string cvalue, string cinifile
 
Set path to "E: \ foxproproject"
& Do writeinifile in writeinifile with "Hello World"
Writeinifile ("Hello World ")

 

Writeinifile. PRG content

Procedure writeinifile
Parameters lcvalue
Constring = "connectionstring"
Lcentry = "ABC"
= Writeprivstr (constring, lcentry, lcvalue, curdir () + "formposi. ini ")
MessageBox (lcvalue)
Endproc

Note:
The comment identifier of FoxPro is &, or * | *
When we call a function, the function is generally written in the PRG file.
If we do not want to use do function in prgfile with parameter
The function name should be consistent with the file name for saving the function.

Curdir () is the path set by the application. After the program is executed, if the formposi. ini file cannot be found in the current path
In the command window, execute? Curdir () command to check which directory the current directory is

Environment: VFP 9.0 SP2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.