Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Creating two-byte hashes for a list of URLs
How to play a waveform sound (a WAV file in particular)
StrDup returns a pointer to the duplicate of a source VFP string
Displaying the drive type value
Extended OS Version info
GDI+: enumerating fonts installed on the system
Retrieving current user for the process
Converting characters to upper or lower case
Converting path to original case
Pocket PC: System Registry Viewer
Retrieving Window Class information for the VFP window
Retrieving national language settings
Determining whether or not the system is connected to the Internet
Enumerating connections made to a shared resource for the local computer (WinNT only)
How to check whether the system is 32-bit or 64-bit
Joining local computer to a domain (XP/2000)
An alternative way of setting Form.Closable to False
How to fill a buffer with random bytes using Cryptography API Functions
Obtaining the System and Windows folder names
Using IsChild() for testing ThisForm.ShowWindow property
Using Video Capture: enumerating installed capture drivers
Obtaining window class name for the main VFP window
Pocket PC: modifying keys in the System Registry
PocketPC: creating directories and files
Pocket PC: creating new database in the Object Store and copying Contacts Database records into it

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:
Start ActiveSync and establish connection with your Pocket PC before the testing.

The code is based on base RAPI Database class and on custom RAPI Database class for operating with the Object Store Databases. Download both class modules prior to testing this code.
 
SET PROCEDURE TO clsRapi ADDITIVE
SET PROCEDURE TO clsRapiDb ADDITIVE
 
PRIVATE oRapi As TrapiDb
oRapi = CREATEOBJECT("TrapiDb")
 
IF NOT oRapi.Connected
    = MESSAGEBOX("Mobile device is unavailable.     ", 48, "Error")
    RETURN
ENDIF
 
LOCAL cDbname, dbsrc As RapiDatabase, dbdst As RapiDatabase,;
    nIndex, oProp As RecProperty, nRecordOid
 
cDbname="dbContactsCopy"
 
WITH oRapi.databases
    * re-creates empty database
    .DeleteDatabase(m.cDbname)
    .CreateDatabase(m.cDbname)
 
    dbsrc = .GetDatabase("Contacts Database")
    dbdst = .GetDatabase(m.cDbname)
ENDWITH
 
IF NOT dbsrc.OpenDatabase()
    = MESSAGEBOX("Error code:" +;
        TRANSFORM(dbsrc.errorcode) + ".     " + CHR(13) +;
        "Could not open source database.     ", 48, "Error")
    RETURN
ENDIF
IF NOT dbdst.OpenDatabase()
    = MESSAGEBOX("Error code:" +;
        TRANSFORM(dbsrc.errorcode) + ".     " + CHR(13) +;
        "Could not open target database.     ", 48, "Error")
    RETURN
ENDIF
 
* copying each property of each record in the source database
* to the target database
FOR nIndex=0 TO dbsrc.dbreccount-1
    dbsrc.goto(nIndex)
 
    * initial zero value of the record oid
    * causes the system to create new record
    nRecordOid=0
    FOR EACH oProp IN dbsrc.props
        = dbdst.WriteProp(@nRecordOid, oProp)
    NEXT
NEXT
dbsrc.CloseDatabase
dbdst.CloseDatabase
 
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1334 bytes  
Created: 2004-08-23 13:32:00  
Modified: 2009-02-15 19:32:38  
Visits in 7 days: 65  
Listed functions:
Printer friendly API declarations
My comment:


#kwd: sln_pocketpc.
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 (107.20.129.212)
3 sec.Example: 'Removing FTP directory'
4.06 hrs.Example: 'How to delete all print jobs for a printer'
8.12 hrs.Example: 'Retrieveing information about the active window (even if it is not owned by the calling process)'
 Example: 'Converting a decimal string to an integer'
10.85 hrs.Function: 'GetIconInfo'
Function group: 'Icon'
16.41 hrs.Function: 'ChooseFont'
18.19 hrs.Example: 'Encapsulating access to the Windows Services in a class'
20.51 hrs.Example: 'Retrieving country-specific dialing information from the Windows Telephony list of countries'
 Example: 'Retrieving information about the main VFP window'
20.9 hrs.Function: 'GetKeyState'
Function group: 'Keyboard Input'
Google
Advertise here!