Here is what I'm doing-- I created a workflow DLL which contains all my workflows, and expose a single class RequestManager so that my win form app dosen't need to know there is WF behind it. The call from win form app is very simple:
InstanceID= RequestManager.Exec(WorkflowCode, Params);
Since all my flow should return the result immediately, I made the flow run in sync mode by call
waitHandle.Set(); ..
waitHandle.WaitOne() in RequestManager.Exec function.
Here is my problem : while everything works sort of OK, but if I pop-up a messagebox within the flow, and I drag that messagebox around on my main form , you will see 1, a heave delay on the may form , 2. and all the values in the input controls on main form are all disapeared until the flow is finished.
I think the reason is that since I use waitHandle, it will try to use the same thread from the one that runs the main form also. As long as I took out the waitHandle logic ,ie. running workflow in async mode, everything is fine. But async mode is not what I want.
See if anyone can help. Appreciate.

Threading question again.
ErnieJ
Hi Walter,
The above behavior is expected. If you want the UI of your windows form to remain responsive whilst your workflow instance is executing you will have to re-model your problem as an asynchronous interaction. Workflow actually helps you to do this.
Can you explain why you want your UI thread to block until the workflow completes I'd suggest that whatever you are doing after the UI thread has finished blocking will have to be modelled in some other asynchronous way.
Regards,
Paul
Joey2006
Hi Paul , thanks for the reply first. The reason I want to run my workflow in sync way ( not intent to block the thread) is because
1. my workflow is running very fast, there is no need to complecate the coding
2.To code it in a async way may works but I have to admit that not every one is confortable with asnyc coding. -- I post a similar concern on another discussion thread.
3. My workflow dll as a core business class will be exposed as webserice or referenced by some winform app directly. That's why I want to create a Manager class to hide all detail workflow implementation.
By the way, the reason I found this issue is becasue I use a traditional way to debug -- messagebox window. I didn't have the problem in the regular .NET coding-- I guess by default it may live in a different thread. But workflow engine force me to stay on the same one.
Regards,
Walter