473,387 Members | 1,693 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,387 software developers and data experts.

What is the best approach?

Hi, friends,

We need to programm a .dll (C#) which will collect all selected files from
various locations, such as a DB, a file system, a VSS, etc. So, it may take
long time. I created a method GetAllFiles() to iterate/fetch each file, and
it works fine.

However, since this method is called from a Windows app (VC#), and users
want to see real time status for each file. What is the best approach to
implement this requirement? Create another thread in .dll to chech the
status, or raise an even, ....? Any ideas, reference papers, sample code, and
etc.?

Thanks a lot for your help...
Jul 21 '05 #1
2 1431
Write the GetAllFiles() method so that it fires status update events,
call the method asynchronously using a new thread or by simply using
BeginInvoke() on a delegate and then in the event handler for status
update event update the UI as desired.

For a good discussion in various issues regarding Multi-Threaded
development refer to
http://www.yoda.arachsys.com/csharp/threads/
http://msdn.microsoft.com/library/de...ms06112002.asp
http://msdn.microsoft.com/library/de...ms01232003.asp

Sijin Joseph
http://www.indiangeek.net
http://weblogs.asp.net/sjoseph
Andrew wrote:
Hi, friends,

We need to programm a .dll (C#) which will collect all selected files from
various locations, such as a DB, a file system, a VSS, etc. So, it may take
long time. I created a method GetAllFiles() to iterate/fetch each file, and
it works fine.

However, since this method is called from a Windows app (VC#), and users
want to see real time status for each file. What is the best approach to
implement this requirement? Create another thread in .dll to chech the
status, or raise an even, ....? Any ideas, reference papers, sample code, and
etc.?

Thanks a lot for your help...

Jul 21 '05 #2
What I would probably do is regularily raise an event. You can pass
informations in the parameters: an integer indicating the progress, and a
string to describe the current action (if needed). Then, in the Windows app,
you can catch that event to update the UI.

Etienne

"Andrew" <An****@discussions.microsoft.com> wrote in message
news:CD**********************************@microsof t.com...
Hi, friends,

We need to programm a .dll (C#) which will collect all selected files from
various locations, such as a DB, a file system, a VSS, etc. So, it may
take
long time. I created a method GetAllFiles() to iterate/fetch each file,
and
it works fine.

However, since this method is called from a Windows app (VC#), and users
want to see real time status for each file. What is the best approach to
implement this requirement? Create another thread in .dll to chech the
status, or raise an even, ....? Any ideas, reference papers, sample code,
and
etc.?

Thanks a lot for your help...

Jul 21 '05 #3

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

Similar topics

2
by: Navin | last post by:
HI, Guys There has been a lot of Ways to use paging in asp 1>Recordset approach -where whole records are pulled at client side... and then only the records which are needed are filtered.. and...
7
by: Hostile17 | last post by:
I'm trying to arrive at a kind of "industry standard" or "best practice" approach to CSS for a policy document aimed at developers, but not necessarily very experienced developers. What does the...
3
by: Chris Transcend | last post by:
Hi all, I'm writing my first .NET website and am wondering what the best method for including headers and footers is. I was thinking either a user or server control but am not sure which would...
1
by: Andy Britcliffe | last post by:
Hi I'm faced with the situation where I could have a single physical file that could contain multiplie XML documents e.g file.txt contains the following: <?xml version="1.0"...
16
by: LP | last post by:
Hi, Every morning a .NET application downloads a file with cumulative data which needs to be appended to SQL Server table. This program needs to identify records that have not been previously...
8
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that...
2
by: Andrew | last post by:
Hello, friends, I implemented Forms Authentication in my asp.net app, it worked fine. However, now I have another problem: Although a user can be authenticated, but he/she may still not be...
4
by: Jeff | last post by:
Hey ASP.NET 2.0 I'm about to create a UserControl for my web project, but I'm wondering if I need to create 2 UserControls instead. Because these UserControls will be very similar, the only...
6
by: bill | last post by:
I am about to start on a module that will accept a location from a user, use Google geolocation services to get the lat/lon and then compute the distance from the site visitor to about 100 kennels...
184
by: jim | last post by:
In a thread about wrapping .Net applications using Thinstall and Xenocode, it was pointed out that there may be better programming languages/IDEs to use for the purpose of creating standalone,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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
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
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
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...

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.