>I need some help in using API calls to OpenFile, WriteFile and CloseFile – declarations and examples of usage, especially to communicate with the modem.
If all you need is low-level file I/O, you have the necessary tools in VFP as native functions; take a look at FOPEN/FCREATE and the related low-level file I/O commands.
If you want to access serial devices, I'd look at using the MSCOMM32.OCX communications control, which provides access to serial ports through an OLE Automation interface. The MSCOMM control documentation shows examples in C and VB; the VB code is fairly easy to port to VFP. The best source of information is the MSDN documentation. I believe there are simple examples of using the MSCOMM control available for download here on UT in the Files section.
If you're going to be accessing a modem, you might do better to use one of the higher-level APIs; for example, TAPI provides high-level telephony capabilities that hide the low-level modem functionality so that you can write applications that will not be tied hard to modem/serial port functionality. If you're using it to connect to the internet, WinSock alleviates the need to know how the connection is made to the internet.