Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using InternetSetFilePointer when resuming interrupted download from the Internet
Placing an arbitrary rectangular area of main VFP window on the Clipboard
Reading the structure of VFP main menu
How to block the ALT+TAB shortcut (WinXP)
How to delete IE cookies, clear IE history and delete files in Temporary Internet Files directory
Using Change Notification Objects to monitor changes to the printer or print server
Winsock: retrieving the standard host name and IP address for the local machine
How to create a desktop shortcut (shell link)
Monitoring changes occurring within a directory
Creating a clipping region from the path selected into the device context of a form
Obtaining information about all user accounts on a server (WinNT only)
Retrieving list of available disk drives
Using FtpCommand
Using the SetErrorMode for determining if a floppy drive is ready
Displaying printer-properties Property Sheet for the specified printer
Enumerating ports that are available for printing on a specified server
How to make the caption of a VFP application flashing in the Windows task bar
Monitoring changes in a directory
OS version and revision
Retrieving current settings for an ODBC connection
Retrieving the User Datagram Protocol (UDP) listener table
Testing serial ports
Using an Event Object. Part B: running an application responding to events
Displaying dimmed window behind VFP top-level form
Using InternetSetFilePointer when resuming interrupted download from the Internet

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:
The remote source file, presented in this example, is large enough -- 3 465 231 bytes.

When running this code try to interrupt it completely by pushing the Esc key, and starting the program again one or more times to complete the download. Clear memory or even quit VFP between the calls.
 
  Members area. Log in to view this example.
 
  User name:
  Password:
 
 
  Forgot your password?
 
  Sign up for
the Membership
 
 


User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
4232 bytes  
Created: 2001-11-13 19:11:14  
Modified: 2011-12-10 09:20:22  
Visits in 7 days: 111  
Listed functions:
CloseHandle
CreateFile
GetFileSize
InternetCloseHandle
InternetOpen
InternetOpenUrl
InternetReadFile
InternetSetFilePointer
OpenFile
SetFilePointer
WriteFile
Printer friendly API declarations
My comment:
If the target local file is found, the program opens the source remote file and sets its pointer equally to the local file size. The local pointer is set to EOF position.

The InternetSetFilePointer parameters include pReserved parameters, which MSDN suggests to set to zero. After comparing interfaces of InternetSetFilePointer and SetFilePointer it is quite logical to say that this parameter is similar to the lpDistanceToMoveHigh (high DWORD).

The simplest way to check this assumption is to download in N-steps a remote file larger than 0xffffffff (4,294,967,295) bytes -- 4 Gb. And at least one interruption should be made after the critical DWORD length offset.
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 (72.44.48.122)
4 sec.Example: 'How to hot-track menu item selection in top-level form (requires VFP9)'
41.75 min.Example: 'How to fill a buffer with random bytes using Cryptography API Functions'
41.8 min.Function: 'WaitForSingleObject'
41.85 min.Example: 'How to delete all print jobs for a printer'
1.64 hrs.Example: 'Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)'
 Function: 'LsaLookupSids'
Function group: 'Security'
 Function: 'WTSUnRegisterSessionNotification'
2.6 hrs.Function: 'DrawAnimatedRects'
Function group: 'Painting and Drawing'
 Example: 'Displaying printer-properties Property Sheet for the specified printer'
3.33 hrs.Example: 'Tracking mouse movement to detect when to start dragging'
Google
Advertise here!