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

Process messages ?

Hi All,

I have created this UI program, i call couple of database procedures and
update process steps to list box.

Program runs fine, but I have problem. What happens is I dont see the update
as it happens, I see all of them after completing all the procedure run.

for example:

UpdateList("Step one about to start");

try{
run proc();
UpdateList("Step one completed");
}catch(Exception ex){
UpdateList("error running proc");
}
UpdateList("Step two about to start");
try{
run proc2();
UpdateList("Step two completed");
}catch(Exception ex){
UpdateList("error running proc2");
}
in updateList I show the status log.

In other language (powerbuilder), i call yield() function to update the ui
and free the message queue.
Any help is appreciated.

Thanks,
--
-RajS
Nov 17 '05 #1
2 4444
Message processing and other events in .NET all depends on what thread such
work is being done in. From the sounds of it, your database work is being
done in the same thread as your main form... one alternative to this would be
of course to spawn off a thread to do the work for you... another that I
would suggest looking into using an asynchronous event.

Take a look at
http://msdn.microsoft.com/library/de...ngoverview.asp for a great overview on this.

In short though, the way Asyncs work is you fire off an AsyncEvent in one
thread, and go back to whatever it was you were doing and wait for the event
to complete. Along the way, you can periodically poll for status, or if you
don’t care, fire it and forget it (forget it as far as the main thread/code
is concerned, however you still have to do a little house cleaning (ie
EndInvoke())).

By firing the AsyncEvents from your main form, you leave it free to
immediately display any updates received, while leaving your code up to be
executed by the system.

Brendan
"RajS" wrote:
Hi All,

I have created this UI program, i call couple of database procedures and
update process steps to list box.

Program runs fine, but I have problem. What happens is I dont see the update
as it happens, I see all of them after completing all the procedure run.

for example:

UpdateList("Step one about to start");

try{
run proc();
UpdateList("Step one completed");
}catch(Exception ex){
UpdateList("error running proc");
}
UpdateList("Step two about to start");
try{
run proc2();
UpdateList("Step two completed");
}catch(Exception ex){
UpdateList("error running proc2");
}
in updateList I show the status log.

In other language (powerbuilder), i call yield() function to update the ui
and free the message queue.
Any help is appreciated.

Thanks,
--
-RajS

Nov 17 '05 #2

"RajS" <Ra**@discussions.microsoft.com> wrote in message
news:54**********************************@microsof t.com...
Hi All,

I have created this UI program, i call couple of database procedures and
update process steps to list box.

Program runs fine, but I have problem. What happens is I dont see the
update
as it happens, I see all of them after completing all the procedure run.

for example:

UpdateList("Step one about to start");

try{
run proc();
UpdateList("Step one completed");
}catch(Exception ex){
UpdateList("error running proc");
}
UpdateList("Step two about to start");
try{
run proc2();
UpdateList("Step two completed");
}catch(Exception ex){
UpdateList("error running proc2");
}
in updateList I show the status log.

In other language (powerbuilder), i call yield() function to update the ui
and free the message queue.
Any help is appreciated.

Thanks,
--
-RajS

Nov 17 '05 #3

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

Similar topics

1
by: jenny | last post by:
Hi, I have a java socket program running on AIX 4.3.3.0 platform. It opens a socket and sends data to our customer over a leased fractional T1 line. The line is always connected. However,...
77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
10
by: pacemkr | last post by:
Is it possible to start a process (using Process.Start or other methods) as a modal window? Meaning, I dont want the C# form that started the process to become "current" untill the started process...
0
by: rob | last post by:
Hello, I have a DOS program that I need to execute from a WinForm application. This DOS program will take a long time to execute. During execution it prints out messages. While the DOS program...
3
by: Bill | last post by:
I am copying data from one FileStream to another in a loop. Inside the loop I display progress messages in a StatusBar. The form has a Stop button that sets a private Boolean variable to true....
4
by: Paul Baker | last post by:
Hello All, This is my first post so apologies if this is the wrong newsgroup. I'm designing software for a platform that will sit on a CAN bus. There will be three separate programs running...
6
by: Laser Lu | last post by:
Thanks for looking at this post:) Does anyone knows how to make the asp.net process runs in the UserInteractive mode? I just want to show some Windows Forms in my asp.net application on the...
3
by: jan.loucka | last post by:
Hi, Is there any way in .NET how to capture WIN API messages that belong to different application? We have a Windows Form app written in .NET 2.0 and from our application we're running another...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a C# application in which I start another process which produces output to stdout and stderr. In fact, that process is the uSoft VS2005 C/C++ compiler itself! I would like to...
0
by: RSH | last post by:
I have seen numerous examples of progressbars using ajax during long running processes. My issue is basically I have a long running process that must be implemented using a web front end. My...
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: 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?
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
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.