K
klumsy
this may be a little difficult for me to explain the first time round,
but here goes.
i have a form. and a method like
public void doyourprocessing
{
....
}
well normally if you say have a button and call doyourprocessing, it
will run the function, then end, giving focus back to the form, and the
forms main windows message loop.
however in my case I want it to behave differently. i want to be able
to say inside here have a loop that says, do the forms main windows
messaging loop until a certian condition (i.e a variable becomes true)
, in order to keep execution inside this function.
the reason why i want to do this , and the context is:
there is a third party librqary which will call doyourprocessing, the
processing i have to do however requires user interaction.. i can
successfully do this by making another form and showing it modal inside
this function (since the function hasn't exited while the modal form si
open) because the modal form has its own messaging loop going on.
However i really want to have the functionality in my main form, not
having to put up another form.. my idea is someting like this (but it
doesn't work)
public void doyourprocess
{
while ( !processingcomplete)
Application.Doevents();
}
does anybody know the correct way to achieve what i am trying? will it
involve multiple threads, and mutexes and such?
but here goes.
i have a form. and a method like
public void doyourprocessing
{
....
}
well normally if you say have a button and call doyourprocessing, it
will run the function, then end, giving focus back to the form, and the
forms main windows message loop.
however in my case I want it to behave differently. i want to be able
to say inside here have a loop that says, do the forms main windows
messaging loop until a certian condition (i.e a variable becomes true)
, in order to keep execution inside this function.
the reason why i want to do this , and the context is:
there is a third party librqary which will call doyourprocessing, the
processing i have to do however requires user interaction.. i can
successfully do this by making another form and showing it modal inside
this function (since the function hasn't exited while the modal form si
open) because the modal form has its own messaging loop going on.
However i really want to have the functionality in my main form, not
having to put up another form.. my idea is someting like this (but it
doesn't work)
public void doyourprocess
{
while ( !processingcomplete)
Application.Doevents();
}
does anybody know the correct way to achieve what i am trying? will it
involve multiple threads, and mutexes and such?