473,326 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

threads, forms, and com automation

I'm working on a VB.net app that uses IE, some forms, and multiple
execution threads. I'm unclear on a couple of threading related
matters and hoped that someone could provide some insight.

From within a thread of execution, if I do a form.show, what thread
does the form process execute on? Is the form process supported by
its own thread? When the form post an event that my code catches such
as a button press, what thread does the event handler execute on? Can
I safely do a wait in the thread that does the form.show and still
handle form events such as a button press?

Similarly, from within a thread of execution, if I start a new
instance of IE what thread does it execute on? It looks to me as
though it is on its own seperate thread and process. Is this correct?
If I catch IE events such as DocumentComplete, what thread does the
event handler execute on? Can I safely do a wait in the thread that
starts IE and still handle IE events?

Thanks for any insight.

Richard

Nov 20 '05 #1
2 994

Window resouce belongs to the thread which creates it. So when one of your
thread creates a form, the message of that window will be queued in the
message queue of that thread, and that thread will run code to handle those
messages, including the button click event.
So if that thread quits, the window will be destroyed. And if the thread is
in a loop and waiting something without processing window message. The UI
of the window will hang up, and won't response to the button press.

Did you create an IE process or just a control?

Nov 20 '05 #2

Thanks, that helped.

I created an IE process, not a control. It appears to me that IE is
in its own process with its own thread(s) but that my event handlers
execute in my process. I'm not sure, however, what thread within my
process they execute on and if I can safely do a wait in the thread
that starts IE and still handle IE events?

On Thu, 04 Mar 2004 20:31:02 GMT, no****@nospam.net (Lifeng Lu) wrote:

Window resouce belongs to the thread which creates it. So when one of your
thread creates a form, the message of that window will be queued in the
message queue of that thread, and that thread will run code to handle those
messages, including the button click event.
So if that thread quits, the window will be destroyed. And if the thread is
in a loop and waiting something without processing window message. The UI
of the window will hang up, and won't response to the button press.

Did you create an IE process or just a control?


Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Drakier Dominaeus | last post by:
This is my first time posting here, so please forgive me if I do anything incorrectly. I've been learning C# and working with different things and decided I wanted to get into Multi-Threading....
6
by: SamIAm | last post by:
Hi am creating a email application that needs to mail out a very large amount of emails. I have created a multithreaded c# application that using message queuing. I have created a threadpool of 5...
1
by: Wesman | last post by:
Threads, textboxes and scrolling Thanks in advance for any information on this matter. I have run into a small richtextbox, scrolling and tread issue. Which has me totally confused. Instead of...
3
by: bygandhi | last post by:
Hi - I am writing a service which will check a process and its threads for their state ( alive or dead ). The process has 5 .net managed threads created using thread.start and each have been...
0
by: Steven Thomas | last post by:
I have a windows service that uses office xp automation. Here is the code --------------------------------------- Public Sub CAccessSnapShot() Try Dim objAccess As New Access.Application() Dim...
0
by: Becker | last post by:
I have a datatable that I use to display running processes. These running processes are spawned as different threads. I use the readerwriterlock class to ensure that when I write to the datatable,...
3
by: Keith Mills | last post by:
Hello, please find attached a basic outline of what I am attempting to accomplish... basically I want to create a number of THREADS (which I can do fine), but I then need a method for them to be...
4
by: gsimmons | last post by:
I've been researching multi-threaded WinForms apps and thread synchronization stuff for a couple days since I'm working on refactoring a multi-threaded GUI app at work and want to be sure it's...
9
by: thiago777 | last post by:
Question details: VB .NET / threads / events / GUI Imagine the following situation: A method from object "A" creates "n" threads. Variables from these threads contains values that should...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
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
0
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...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.