Click here to Skip to main content
15,892,298 members
Home / Discussions / C#
   

C#

 
GeneralCOM+ and remoting: Lifetime Pin
devvvy12-Oct-03 19:04
devvvy12-Oct-03 19:04 
GeneralLaunching GUI from Windows Service Pin
devvvy12-Oct-03 18:58
devvvy12-Oct-03 18:58 
GeneralRe: Launching GUI from Windows Service Pin
Randhir Sinha12-Oct-03 21:52
Randhir Sinha12-Oct-03 21:52 
GeneralHighliting text Pin
Srikar Y12-Oct-03 18:31
Srikar Y12-Oct-03 18:31 
Questionhow to catch exception throw inside in worker thread? Pin
zecodela12-Oct-03 16:31
zecodela12-Oct-03 16:31 
AnswerRe: how to catch exception throw inside in worker thread? Pin
Randhir Sinha12-Oct-03 22:04
Randhir Sinha12-Oct-03 22:04 
GeneralRe: how to catch exception throw inside in worker thread? Pin
zecodela12-Oct-03 22:19
zecodela12-Oct-03 22:19 
GeneralRunning forms on seperate thead Pin
SharpKnight12-Oct-03 11:34
SharpKnight12-Oct-03 11:34 
Hi,

I have some intensive code that is running on my main thread. I try to show a status update on a 'status form'. The problem that i have is that because it is running in the same thread the window is not responding to the user.

The user is now able to minimize, move the window because the code is too busy on it's own work.
(and they are all running on the same thread)

I thought the solution would be to run the window on a seperate thread. so I added the following code: 1 method called CreateStatusForm that creates the form and assigns it to my variable _frmStatus, and my code running this method in a seperate thread:

private void CreateStatusForm()
{
_frmStatus = new AdwareForm();
fInitializedStatus = true;
}

private AdwareTrace()
{
_oFormThread = new Thread(new ThreadStart(this.CreateStatusForm));
_oFormThread.Name = "Thread: StatusForm";
_oFormThread.Start();

while (oFormThread.IsAlive)
{
Thread.Sleep(250);
}
and so on ...

the problem is that on the initialization of the window runs on the seperate thread.
After the initialization the window does not respond to the user again.

Can anybody tell me how to run forms on seperate threads so that the users can continue to interact with it ?
Thanks very much in advance for your help,

Regards, SharpKnight



SharpKnight
GeneralRe: Running forms on seperate thead Pin
12-Oct-03 21:33
suss12-Oct-03 21:33 
GeneralPInvoke CreateProcess Pin
devvvy12-Oct-03 9:31
devvvy12-Oct-03 9:31 
GeneralRe: PInvoke CreateProcess Pin
devvvy12-Oct-03 9:54
devvvy12-Oct-03 9:54 
GeneralRe: PInvoke CreateProcess Pin
J. Dunlap12-Oct-03 9:57
J. Dunlap12-Oct-03 9:57 
GeneralRe: PInvoke CreateProcess Pin
devvvy12-Oct-03 10:00
devvvy12-Oct-03 10:00 
GeneralPInvoke CWnd Pin
devvvy12-Oct-03 10:24
devvvy12-Oct-03 10:24 
GeneralRe: PInvoke CWnd Pin
J. Dunlap12-Oct-03 10:48
J. Dunlap12-Oct-03 10:48 
GeneralRe: PInvoke CWnd Pin
devvvy12-Oct-03 10:52
devvvy12-Oct-03 10:52 
GeneralRe: PInvoke CWnd Pin
Nick Parker12-Oct-03 11:00
protectorNick Parker12-Oct-03 11:00 
GeneralRe: PInvoke CWnd Pin
devvvy12-Oct-03 11:06
devvvy12-Oct-03 11:06 
Generaladding components to the designer by code Pin
Roger Alsing12-Oct-03 2:40
Roger Alsing12-Oct-03 2:40 
GeneralRe: adding components to the designer by code Pin
Rod O12-Oct-03 5:03
Rod O12-Oct-03 5:03 
GeneralRe: adding components to the designer by code Pin
Roger Alsing12-Oct-03 22:10
Roger Alsing12-Oct-03 22:10 
GeneralCOM+ Pin
devvvy12-Oct-03 1:20
devvvy12-Oct-03 1:20 
GeneralMicrothreads Pin
bjoernen12-Oct-03 0:58
bjoernen12-Oct-03 0:58 
GeneralRe: Microthreads Pin
Blake Coverett12-Oct-03 3:01
Blake Coverett12-Oct-03 3:01 
GeneralRe: Microthreads Pin
Bo Hunter12-Oct-03 7:05
Bo Hunter12-Oct-03 7:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.