473,406 Members | 2,343 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,406 software developers and data experts.

Using Progress Bars with CopyFileEx

I know this has come up a couple of times on the group, but I'm still having
trouble with it.

I'm fine with creating the delegate and CopyFileEx declarations and the function
which gets delegated to. The problem I have is the actual updating of the
progress bar. I can understand passing a pointer through the ldata paramater
in C++, but I can't find an example of what to do in C#. In all the examples
using delegates that I have found, they've always done things like Console.Write
or other things that don't access instance variables.

Please Help!!!

H Glenn Hatfield
Nov 15 '05 #1
2 6739
I can understand passing a pointer through the ldata paramater
in C++, but I can't find an example of what to do in C#.


You probably don't have to, since a delegate can refer to a specific
instance method.

But you have to use Control.Invoke to make sure the progress bar is
updated from the GUI thread.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 15 '05 #2
You shouldn't have to worry about any of that (passing lParam or
wParam). Rather, you will have to create another delegate that has the
signature of the function you want called as the callback (when you received
the callback notification from CopyFileEx), and then pass that to the Invoke
method.

Can you show some of your code? It would help.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com
"H Glenn Hatfield" <hg*@byu.edu> wrote in message
news:fb*************************@posting.google.co m...
I know this has come up a couple of times on the group, but I'm still having trouble with it.

I'm fine with creating the delegate and CopyFileEx declarations and the function which gets delegated to. The problem I have is the actual updating of the
progress bar. I can understand passing a pointer through the ldata paramater in C++, but I can't find an example of what to do in C#. In all the examples using delegates that I have found, they've always done things like Console.Write or other things that don't access instance variables.

Please Help!!!

H Glenn Hatfield

Nov 15 '05 #3

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

Similar topics

1
by: Xarky | last post by:
Hi, I am trying to use progress bars, where the progress is seen as vertical. I am succeding to manage progess bars, where progress is increasing horizontally, but not vertically. Can someone...
5
by: Søren Reinke | last post by:
Hi there I am working on a program where the user should be able to import some CSV files. With my set of test data, it takes about 2 minutes to import, while it is importing the program sort...
6
by: Kyle | last post by:
I want to do a single pix update bar instead of the big block that progress bars usually use. I can't seem to find any info on how to do this. Thanks in advance for any help, Kyle
11
by: simon | last post by:
when I execute aspx page, it works about 5 minutes - I calculate some statistics. Is there some way, that I can show user time bar or smething similar? That he nows, that page is working. ...
3
by: Paul | last post by:
I have been trying to code a callback in vb.net using the delegate method. I have successfully compiled the program and run it but after it accessess the copyfileex winapi method and then calls the...
2
by: Robert Smith | last post by:
Hello, I have a problem with my progress bar, as shown in the attached code, the values on the bar are incremented within a threaded timer event. The timer works fine and ticks all the way...
2
by: hzgt9b | last post by:
I've been executing the CopyFileEx code below in a Windows Application for several months... Try If CopyFileEx(fiSource.FullName, strTargetFile, Fpr, ACTION_COPY, 0, 0) 0 Then Else Throw New...
3
by: Ritesh Raj Sarraf | last post by:
Hi, I have a small application, written in Python, that uses threads. The application uses function foo() to download files from the web. As it reads data from the web server, it runs a progress...
2
by: bryangrif | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.