Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
Questionmultithreading problem Pin
CherezZaboro29-Jun-06 10:58
CherezZaboro29-Jun-06 10:58 
AnswerRe: multithreading problem Pin
Josh Smith29-Jun-06 11:10
Josh Smith29-Jun-06 11:10 
QuestionRe: multithreading problem Pin
therealmccoy29-Jun-06 12:03
therealmccoy29-Jun-06 12:03 
AnswerRe: multithreading problem Pin
Mike Poz29-Jun-06 21:22
Mike Poz29-Jun-06 21:22 
GeneralRe: multithreading problem Pin
CherezZaboro30-Jun-06 5:50
CherezZaboro30-Jun-06 5:50 
GeneralRe: multithreading problem Pin
Mike Poz30-Jun-06 7:02
Mike Poz30-Jun-06 7:02 
QuestionRe: multithreading problem Pin
CherezZaboro30-Jun-06 7:27
CherezZaboro30-Jun-06 7:27 
AnswerRe: multithreading problem Pin
Mike Poz30-Jun-06 10:40
Mike Poz30-Jun-06 10:40 
inner wrote:
// oDCRR is the COM object that is created in main thread and in this second thread
// does something very long in the ExecuteEx


Okay, so this comment explains the real problem. The main thread is also the UI thread so if you execute a COM process that takes a while to complete, you're litterally blocking the UI thread.

I can't guarantee this will work but you need to take the COM operation of the UI/main thread. I would try something like this as this is similar to what I did on my KanaFlash program:

//in the class declaration
private Thread MyCOMThread = null;

private void OnBtnExecute(object sender, DoWorkEventArgs e)
{
// oDCRR is the COM object that is created in main thread and in this second thread
// does something very long in the ExecuteEx
MyCOMThread = Thread(new ThreadStart(PerformCOMOperation));
MyCOMThread.Start();
}

private void PerformCOMOperation()
{
e.Result = oDCRR.ExecuteEx();
MyCOMThread.Abort();
ProcessResults(whatever you need here...);
}

//create a MyCOMThread complete event results processor here
private void ProcessResults(some param)
{
//process results
}

Hope this helps!

Mike Poz
QuestionReflection with static inherited methods Pin
osamahmirza29-Jun-06 10:45
osamahmirza29-Jun-06 10:45 
AnswerRe: Reflection with static inherited methods Pin
Josh Smith29-Jun-06 11:04
Josh Smith29-Jun-06 11:04 
GeneralRe: Reflection with static inherited methods Pin
guroo1329-Jun-06 12:57
guroo1329-Jun-06 12:57 
AnswerRe: Reflection with static inherited methods Pin
Guffa29-Jun-06 13:40
Guffa29-Jun-06 13:40 
GeneralRe: Reflection with static inherited methods Pin
guroo1329-Jun-06 13:51
guroo1329-Jun-06 13:51 
QuestionVS 2005 User Control Toolbox question Pin
LongRange.Shooter29-Jun-06 10:34
LongRange.Shooter29-Jun-06 10:34 
AnswerRe: VS 2005 User Control Toolbox question Pin
Kamal Sagar30-Jun-06 1:10
Kamal Sagar30-Jun-06 1:10 
GeneralRe: VS 2005 User Control Toolbox question Pin
LongRange.Shooter30-Jun-06 11:55
LongRange.Shooter30-Jun-06 11:55 
QuestionHere's a wierd one for you... Pin
BoneSoft29-Jun-06 10:29
BoneSoft29-Jun-06 10:29 
AnswerRe: Here's a wierd one for you... Pin
LongRange.Shooter29-Jun-06 10:38
LongRange.Shooter29-Jun-06 10:38 
GeneralRe: Here's a wierd one for you... Pin
BoneSoft29-Jun-06 10:44
BoneSoft29-Jun-06 10:44 
AnswerRe: Here's a wierd one for you... Pin
led mike29-Jun-06 10:51
led mike29-Jun-06 10:51 
GeneralRe: Here's a wierd one for you... Pin
BoneSoft29-Jun-06 10:55
BoneSoft29-Jun-06 10:55 
AnswerRe: Here's a wierd one for you... Pin
Josh Smith29-Jun-06 11:09
Josh Smith29-Jun-06 11:09 
GeneralRe: Here's a wierd one for you... Pin
BoneSoft29-Jun-06 11:12
BoneSoft29-Jun-06 11:12 
GeneralRe: Here's a wierd one for you... Pin
Josh Smith29-Jun-06 11:12
Josh Smith29-Jun-06 11:12 
GeneralRe: Here's a wierd one for you... [modified] Pin
BoneSoft29-Jun-06 11:31
BoneSoft29-Jun-06 11:31 

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.