473,387 Members | 1,545 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 1432
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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?
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...

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.