Hello,
While in extensive math calculation in MFC application, i used to yield
control to window by calling this code:
void YieldControl( void )
{
MSG msg ;
if( ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
::TranslateMessage( &msg ) ;
::DispatchMessage( &msg ) ;
}
}
How can I do similar thing in .Net application?
Thank you,
Eitan Barazani 6 3417
Eitan,
Yes, you could. You can call the static DoEvents method on the
Application class in order to process messages that are in the queue.
However, I STRONGLY advise against it. Rather, you should be performing
these calculations on another thread and then calling the Invoke method on a
control, passing a delegate to be executed on the UI thread when you need to
perform an update.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Eitan" <Ei***@discussions.microsoft.comwrote in message
news:45**********************************@microsof t.com...
Hello,
While in extensive math calculation in MFC application, i used to yield
control to window by calling this code:
void YieldControl( void )
{
MSG msg ;
if( ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
::TranslateMessage( &msg ) ;
::DispatchMessage( &msg ) ;
}
}
How can I do similar thing in .Net application?
Thank you,
Eitan Barazani
"Eitan" <Ei***@discussions.microsoft.comwrote in message
news:45**********************************@microsof t.com...
How can I do similar thing in .Net application?
See Nicholas' reply - threading is absolutely the way to do this.
A very popular use of this is updating the panel(s) of a StatusStrip control
while the second thread doing the time-consuming work is running. http://www.google.co.uk/search?sourc...usStrip+thread
-- http://www.markrae.net
Thanks.
Any article that I should look into here?
Eitan
"Nicholas Paldino [.NET/C# MVP]" wrote:
Eitan,
Yes, you could. You can call the static DoEvents method on the
Application class in order to process messages that are in the queue.
However, I STRONGLY advise against it. Rather, you should be performing
these calculations on another thread and then calling the Invoke method on a
control, passing a delegate to be executed on the UI thread when you need to
perform an update.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Eitan" <Ei***@discussions.microsoft.comwrote in message
news:45**********************************@microsof t.com...
Hello,
While in extensive math calculation in MFC application, i used to yield
control to window by calling this code:
void YieldControl( void )
{
MSG msg ;
if( ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
::TranslateMessage( &msg ) ;
::DispatchMessage( &msg ) ;
}
}
How can I do similar thing in .Net application?
Thank you,
Eitan Barazani
Eitan,
This is a pretty common question on the boards. You could search
google, or google groups, with the terms "threading windows forms invoke
delegate" and find a number of posts relating to the subject.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Eitan" <Ei***@discussions.microsoft.comwrote in message
news:9B**********************************@microsof t.com...
Thanks.
Any article that I should look into here?
Eitan
"Nicholas Paldino [.NET/C# MVP]" wrote:
>Eitan,
Yes, you could. You can call the static DoEvents method on the Application class in order to process messages that are in the queue.
However, I STRONGLY advise against it. Rather, you should be performing these calculations on another thread and then calling the Invoke method on a control, passing a delegate to be executed on the UI thread when you need to perform an update.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Eitan" <Ei***@discussions.microsoft.comwrote in message news:45**********************************@microso ft.com...
Hello,
While in extensive math calculation in MFC application, i used to yield
control to window by calling this code:
void YieldControl( void )
{
MSG msg ;
if( ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
::TranslateMessage( &msg ) ;
::DispatchMessage( &msg ) ;
}
}
How can I do similar thing in .Net application?
Thank you,
Eitan Barazani
If you are not familiar with topic, start from this http://msdn.microsoft.com/msdnmag/is...ultithreading/
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:%2****************@TK2MSFTNGP02.phx.gbl...
Eitan,
This is a pretty common question on the boards. You could search
google, or google groups, with the terms "threading windows forms invoke
delegate" and find a number of posts relating to the subject.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Eitan" <Ei***@discussions.microsoft.comwrote in message
news:9B**********************************@microsof t.com...
>Thanks.
Any article that I should look into here?
Eitan
"Nicholas Paldino [.NET/C# MVP]" wrote:
>>Eitan,
Yes, you could. You can call the static DoEvents method on the Application class in order to process messages that are in the queue.
However, I STRONGLY advise against it. Rather, you should be performing these calculations on another thread and then calling the Invoke method on a control, passing a delegate to be executed on the UI thread when you need to perform an update.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Eitan" <Ei***@discussions.microsoft.comwrote in message news:45**********************************@micros oft.com... Hello,
While in extensive math calculation in MFC application, i used to yield control to window by calling this code:
void YieldControl( void ) { MSG msg ; if( ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) { ::TranslateMessage( &msg ) ; ::DispatchMessage( &msg ) ; } }
How can I do similar thing in .Net application?
Thank you, Eitan Barazani
Alex, Thanks!
Eitan
"AlexS" wrote:
If you are not familiar with topic, start from this http://msdn.microsoft.com/msdnmag/is...ultithreading/
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:%2****************@TK2MSFTNGP02.phx.gbl...
Eitan,
This is a pretty common question on the boards. You could search
google, or google groups, with the terms "threading windows forms invoke
delegate" and find a number of posts relating to the subject.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Eitan" <Ei***@discussions.microsoft.comwrote in message
news:9B**********************************@microsof t.com...
Thanks.
Any article that I should look into here?
Eitan
"Nicholas Paldino [.NET/C# MVP]" wrote:
Eitan,
Yes, you could. You can call the static DoEvents method on the Application class in order to process messages that are in the queue.
However, I STRONGLY advise against it. Rather, you should be performing these calculations on another thread and then calling the Invoke method on a control, passing a delegate to be executed on the UI thread when you need to perform an update.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Eitan" <Ei***@discussions.microsoft.comwrote in message news:45**********************************@microso ft.com...
Hello,
While in extensive math calculation in MFC application, i used to
yield
control to window by calling this code:
void YieldControl( void )
{
MSG msg ;
if( ::PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
::TranslateMessage( &msg ) ;
::DispatchMessage( &msg ) ;
}
}
How can I do similar thing in .Net application?
Thank you,
Eitan Barazani
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: vivek |
last post by:
I am trying to install visual studio .NE
The system prompts for windows componet update. When i click that it asks for windows update CD, which eventually I dont have. The readme.txt doc displays...
|
by: Ryan |
last post by:
Hello
Today when installing .NET on Windows XP Pro with all critical updates, etc. installed, I noticed I never had to use the Windows Component Update CD. I successfully got through the...
|
by: Eric Kinkead |
last post by:
(doh... that was me)
Here is the problem....
I try to install my VisualBasic.net Standard Version 2002
But then it just sits there and asks for "Windows Component Update Disk for
Visual...
|
by: lauren quantrell |
last post by:
Is there a way to determine the size of the user's screen minus the
Windows task bar?
I am trying to maximize an Access popup form that is also resizeable
and it is causing me problems since it...
|
by: Steven K |
last post by:
Hello,
I am trying to install vb.net and I am getting the following:
Windows Component Update
Setup has detected that some of the windows components that are installed on
your computer do not...
|
by: Udi |
last post by:
Hi,
I have a listbox and a textbox that are built and shown dynamically.
My problem is that their positions and sizes may cause them to be
displayed out of the their parent form bounds, and in a...
|
by: devecibasi |
last post by:
Hi all,
I have a macro that executes ~200 queries which modify the data, create some tables etc. The macro runs when the user clicks a button on a form. I would like the queries to be invisible...
|
by: =?Utf-8?B?S29uc3RhbnRpbg==?= |
last post by:
I have a need to have a repeater inside update panel control which should
update dynamically when "Update" button is clicked. I have repeater inside
update panel control which takes custom...
|
by: davidson1 |
last post by:
If I am using UNIX,suppose if I need to see the Windows Screen,Is it is Possible,Which Command can be used for that.
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |