Using CopyProgressRoutine with CopyFileEx in MS Visual Studio

Posted on 2003-03-21
Medium Priority
Last Modified: 2007-12-19
I am copying a file with CopyFileEx without problems. I can even get the routine pointed to by lpProgressRoutine to run, but I have not been able to figure out how to access the TotalFileSize and TotalBytesTransferred from the CopyProgressRoutine.
Question by:dcellis1950
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

ID: 8183103
Never mind I figured it out. The lpProgressRoutine instead of having a callback structure that I am use to from unix has individual arguments. So the setup is something like

CopyFileEx (FileIn, FileOut, (LPPROGRESS_ROUTINE) UpdateCopyProgressBar, ptrToProgressBar, bCancel, COPY_FILE_FAIL_IF_EXIST);

Then the callback is

LPPROGRESS_ROUTINE UpdateCopyProgressBar (
LARGE_INTEGER TotalBytesTransfered,
LARGE_INTEGER StreamBytesTransfered,
DWORD  dwStreamNumber,
DWORD  dwCallBackReason,
HANDLE  hDestinationFile,
LPVOID ptrToProgressBar)
\\ Update the progress bar

Simple, but for a time I could not see it.


Accepted Solution

modulo earned 0 total points
ID: 8483862
PAQ'd and points refunded


Community Support Moderator
Experts Exchange

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question