Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file copy with progress bar

Status
Not open for further replies.

cool3d

Programmer
Dec 19, 2001
1
US
hi, i want to make a simple file copying program that shows a dialog box with a progress bar.
I have tried CopyFile command, this doesn't work with progress bars though (i need the progress bar as the files are very large,and the copying takes a little while, so i need to indicate that the copying process is still working). CopyFileEx can be linked to the progress bar, but apparently only works with Windows NT. So not much good to me.i really need something that will work with win95,98,2000,nt,me.
What is the best way i can acheive this (& still copy files quickly)? might it involve fread, fwrite and buffering the info? or maybe a call to a windows shell command?
I am very new to vc++, so any help on writing this is great appreciated :)
 
Here is the requirements for CopyFileEx

Requirements
Windows NT/2000/XP: Included in Windows NT 4.0 and later.
Windows 95/98/Me: Included in Windows 98 and later.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP. Also supported by Microsoft Layer for Unicode.

So it should work fine. Look up CopyProgressRoutine as well. Both these API calls should be the way to achieve what you need. Maybe your version of MSDN is older? You will need to write the progress routine yourself if CopyProgressRoutine does not satify what you need.

Matt

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top