Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using the SetErrorMode for determining if a floppy drive is ready
Adding a background image to VFP report (VFP9, ReportListener)
GetFocus returns a HWND value
How to assemble an array of strings and pass it to external function
How to run FoxPro application under different user name (impersonating user)
Enumerating files opened on the network
GDI+: Creating thumbnails to preview images in a directory
Obtaining OS memory performance information
A procedure for setting file times
GDI+ fun: roach-infested desktop
How to display a dialog box with which the user can add a data source (DSN)
Pocket PC: custom RAPI class for operating with the System Registry
Using mailslots to send messages on the network
Enumerating network interfaces on the local computer
How to enumerate terminal servers within the specified Windows domain
How to obtain the number of rows affected by remote UPDATE, INSERT or DELETE statement
Opening access to the Microsoft Internet functions for the application
Printing text on the client area of the main VFP window
Reading header information from AVI file
Retrieving file information for the VFP executable running
Enumerating sessions established on a server
How to generate GUID values
Monitoring changes occurring within a directory
Pocket PC: base class
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: 114  
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.234.180.187)
32.27 min.Example: 'Converting path to original case'
32.33 min.Example: 'Splash Screen for the VFP application'
43.08 min.Example: 'How to print picture stored in enhanced-format metafile (*.emf)'
43.13 min.Example: 'GDI+: reading and writing metadata in JPEG and TIFF files'
3.1 hrs.Function: 'WTSEnumerateServers'
Function group: 'Terminal Services'
 Function: 'waveInGetDevCaps'
Function group: 'Windows Multimedia'
7.5 hrs.Example: 'GDI+: Creating thumbnails to preview images in a directory'
7.65 hrs.Example: 'The original LoadPicture() function in VFP returns valid handles to bitmaps, icons, cursors, and metafiles'
Google
Advertise here!