Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using an Event Object. Part A: running an application that creates an Event object
Using Custom FTP class (DEFINE CLASS ftp As Custom)
Using Multimedia Command Strings to play MIDI files
Winsock: initializing the service in the VFP application
Enumerating MIDI output devices
Pocket PC: creating new database in the Object Store and copying Contacts Database records into it
Reading data from INI files
Retrieving configuration information for the specified server (Win98/Me)
Retrieving geometrical parameters of the system desktop window
Accessing a CD device (cdaudio) with Multimedia Command Strings
Current directory of the application
Managing Cookies
Copying files as a transacted operation (Vista)
GDI+: converting text strings to images and saving in a graphics file
How to hide your program from the Close Program dialog (Win9* only)
Retrieving the IP-to-physical address mapping table
Saving available locale records into a cursor
GDI+: loading image file, drawing on it, saving the result to another file
Obtaining the bounding rectangle for the specified device context
Retrieving the rectangle area where the mouse cursor is confined
Retrieving window and menu help context identifiers
Current System information
Retrieving top-child window for the VFP form
Simple MAPI: how to pick an email recipient from Outlook Express address book
PocketPC: creating directories and files

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
This example shows how to create directories and files on Windows CE device connected to computer through ActiveSync connection.

Methods of the base class StringToFile and FileToString have similar interface with STRTOFILE and FILETOSTR functions in FoxPro.

The code is based on custom RAPI class. Download the class module first and save it in clsRapiFiles.prg file.
 
#DEFINE CRLF  CHR(13)+CHR(10)
SET PROCEDURE TO clsRapiFiles ADDITIVE
 
LOCAL rapi As Trapi, oFiles As Tfiles
rapi = CREATEOBJECT("Trapi")
oFiles = CREATEOBJECT("Tfiles")
 
#DEFINE ccTargetPath "\my documents\personal\news2news"
#DEFINE ccLogFile ccTargetPath + "\logfile_000.txt"
 
IF NOT oFiles.PathExists(ccTargetPath)
    IF NOT oFiles.CreateDirectory(ccTargetPath)
        ? "Error:", oFiles.errorcode
        RETURN
    ENDIF
ENDIF
 
IF NOT oFiles.FileExists(ccLogFile)
    oFiles.StringToFile("Log created: " +;
        TRANSFORM(DATETIME()) + CRLF, ccLogFile)
 
    * copying VFP configuration file to mobile device
    LOCAL cBuffer
    cBuffer = FILETOSTR(SYS(2019))
    oFiles.StringToFile(cBuffer, ccTargetPath + "\config.fpw")
ELSE
    oFiles.StringToFile("Log written: " +;
        TRANSFORM(DATETIME()) + CRLF, ccLogFile, 1)
ENDIF
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
823 bytes  
Created: 2004-08-11 18:36:44  
Modified: 2004-08-11 18:47:07  
Visits in 7 days: 57  
Listed functions:
Printer friendly API declarations
My comment:
The interface of the base class can be easily made more elaborate by adding functions similar to FoxPro FOPEN, FCREATE, FWRITE, FGETS etc.
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.234.126.92)
48.33 min.Example: 'Configuring DEVMODE structure for a printer'
48.38 min.Function: 'GetRTTAndHopCount'
1.27 hrs.Function: 'DuplicateHandle'
 Example: 'Printing text on the client area of the main VFP window'
15.36 hrs.Function: 'CloseWindow'
Function group: 'Window'
 Example: 'Pocket PC: custom RAPI class for operating with files and folders on mobile device'
 Article: 'ApiViewer for Visual FoxPro '
19.42 hrs.Example: 'How to generate GUID values'
 Example: 'Enumerating ODBC Data Sources available on the local computer'
1 day(s)Example: 'Testing Transparent Menu Class with top-level form (requires VFP9)'
Google
Advertise here!