Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
MapiSendMail class for Visual FoxPro application
Obtaining a handle to the desktop associated with the calling thread
Yet another modal dialog: now HTML-based
Converting path to original case
FindText -- the hopeless and useless Common Dialog
How to download a file from HTTP server using URL Monikers functions
How to find when the application started
How to start the screen saver and how to find whether the screen saver is active
Uploading file to the FTP server using InternetWriteFile
URL: converting unsafe characters and spaces into escape sequences
URL: splitting into its component parts
Using FrameRgn for displaying system colors
Converting long file names to the short format and vice versa
Copying strings through the global memory block
Deleting a file stored on the FTP server
GDI+: cropping images
Loading a string resource from an executable file
Winsock: changing the byte ordering
Converting a decimal string to an integer
Using GetSysColor
Using SQLBrowseConnect to connect to a data source through a number of iterative calls (SQL Server)
Creating hash values for the list of names
How to run FoxPro application under different user name (impersonating user)
How to write and read Window Properties for the specified window
Using the SetErrorMode for determining if a floppy drive is ready

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:
A try to read a floppy-drive that is not ready produces both -- the Windows, and VFP -- error messages under VFP3+WinNT4. In this situation the following code does make a sense. Otherwise under VFP6+WinMe there is no system error message. So ON ERROR redirection is quite enough.
 
#DEFINE SEM_FAILCRITICALERRORS 1
#DEFINE SEM_NOALIGNMENTFAULTEXCEPT 4
#DEFINE SEM_NOGPFAULTERRORBOX 2
#DEFINE SEM_NOOPENFILEERRORBOX 0x8000
 
DECLARE INTEGER SetErrorMode IN kernel32 INTEGER uMode
 
LOCAL lvOldOnError, lnVfpError, lnOldErrorMode
 
* saving the old ErroMode value, and at the same moment
* suppressing a possible system message of no disk in drive
lnOldMode = SetErrorMode (SEM_FAILCRITICALERRORS)
 
* saving the old ON ERROR state
lvOldOnError = ON("ERROR")
lnVfpError = .F.
ON ERROR lnVfpError = .T.
 
SET CONS OFF
DIR a:
SET CONS ON
 
* restoring saved properties
ON ERROR &lvOldOnError
= SetErrorMode (lnOldMode)
 
RETURN  Not lnVfpError
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
678 bytes  
Created: 2001-12-20 18:14:33  
Modified: 2005-12-27 10:45:48  
Visits in 7 days: 109  
Listed functions:
SetErrorMode
Printer friendly API declarations
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.224.79.93)
34.3 min.
Function group: 'Virtual Hard Disk (Win7)'
3.07 hrs.Function: 'HeapAlloc'
 Examples
Page 4
6.24 hrs.Example: 'Establishing connection using the SQLDriverConnect'
Language: 'C++'
 Example: 'How to prevent users from accessing the Windows Desktop and from switching to other applications'
8.31 hrs.Example: 'Retrieving the User Datagram Protocol (UDP) listener table'
 Example: 'Using File Mapping for enumerating files opened by Visual FoxPro'
9.57 hrs.Function: 'NetUserEnum'
 Function: 'RegEnumValue'
Function group: 'Registry'
10.54 hrs.Function: 'CM_Get_Sibling_Ex'
Google
Advertise here!