473,394 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Progress bar updates via callback.

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.

Mar 13 '07 #1
2 4208
On Mar 13, 12:31 am, bryang...@gmail.com wrote:
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?

Mar 13 '07 #2
bg
On Mar 13, 5:14 am, "Andy" <a...@med-associates.comwrote:
On Mar 13, 12:31 am, bryang...@gmail.com wrote:
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?
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.

Mar 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ziggy | last post by:
Please excuse this elementary question...but I am just dumb.... I have taken a simplistic Dialog Box and added a Progress Control. When I did that, my Dialog Box was no longer able to intialize...
4
by: Kenneth Keeley | last post by:
Hi, I have a page that uploads files to my server and I wish to display a "Please wait while uploading" page to the user while the file is uploading. I have been able to redirect the user once the...
3
by: SpamProof | last post by:
I got an animated gif that is a barber pole spinning that I want to use as a progress bar. The problem is that is stops spinning (shows 1 frame) when my browser is processing a submited request...
5
by: Agnes | last post by:
I need to loop a datatable to do some calculation. I want to use progress bar to show the 'process status' Must I need to know the datatable size first ? , if there is 1000 records inside, I need...
0
by: Adam Byrne | last post by:
Been wondering about this... Which is better? (pseudocode - please don't grill me about semantics etc.) public class Thing { public void DoLongOperation(IProgressCallback callback) { for (int...
1
by: GS | last post by:
Hi, I'm using buffering to write to client about progress of long running query, my question is how do I remove everything from browser screen what was written so far once results are ready....
11
by: brother52 | last post by:
I am using My.Computer.FileSystem.CopyFile() to copy a bunch of files from one directoy to another, and would like to display a progress bar on the screen for each file being copied. Is this...
15
by: eladla | last post by:
Hi! I am creating a composite control the does some of it`s own data access. I want to display a progress bar between the time the page is loaded and the control place holder is displayed and...
2
by: durumdara | last post by:
Hi! I want to check my zip file writings. I need some callback procedure to show a progress bar. Can I do that? I don't want to modify the PyLib module to extend it, because if I get another...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.