Progress bar updates via callback.

B

bryangrif

I am attempting to connect a progress bar to my application. I have
created a separate form that has a label and a progress bar. I am
making a call to CopyFileEx via interop to copy files over a network
and would like to use the callback function to update the progress bar
on the form. This application is written in C# with VS 2005.

Any help would be appreciated.
 
A

Andy

I am attempting to connect a progress bar to my application. I have
created a separate form that has a label and a progress bar. I am
making a call to CopyFileEx via interop to copy files over a network
and would like to use the callback function to update the progress bar
on the form. This application is written in C# with VS 2005.

Any help would be appreciated.

Look at the BackgroundWorker component. It will allow the copy to run
on a background thread, and your UI will stay nice and responsive. Is
there a reason you're using interop to copy the files? Does the
System.IO.File class not work in your case?
 
B

bg

Look at the BackgroundWorker component. It will allow the copy to run
on a background thread, and your UI will stay nice and responsive. Is
there a reason you're using interop to copy the files? Does the
System.IO.File class not work in your case?

File.Copy didn't scale so I exposed the function from kernel32.dll.
File.Copy does not have the same functionality as CopyFileExe, it is
missing the callback and cancel features.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top