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 DocumentComplet e, 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 2 1010
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?
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.n et (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? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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. My problem is that I must not be doing it right
because only some of the stuff works as would be expected. I'll post what
exactly is happening, then I'll post the sample code I'm using that is
giving me the problems. I'm sure its something I've...
|
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 threads and each thread
checks the queue, receives the message and sends an email. How do I
determine the right amount of threads to create?
Thanks,
S
|
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 trying to explain it I wrote some small C# code
to demonstrate the fact that in the threaded version the textbox
simple doesn't scroll like it should… please look to the
startButton_Click method for the distinction between the two
programs..
|
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 assigned a name.
As in .net there is no way we can get the managed threads, I am
thinking of making a win32 call and check their status.
|
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 vSQLText, vThreadName As String
Try
vThreadName = Thread.CurrentThread.Name
cFunctions.WriteEventLog("starting report on thread: " &
| |
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, I obtain a write lock.
The datagrid is set to have a datasource of the datatable.
The problem is that I get this error intermittently and it draws a big red X
across my datagrid:
************** Exception Text **************...
|
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 able to communicate with each
other, either through a message loop, or some other manner. I ALSO need to
be able to CALL specific functions / subs WITHIN a thread, based on what
another THREAD is doing... here is the attached code... WHEN I click...
|
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
rock solid/thread-safe. I've seen all the posts about using BeginInvoke
to have worker threads interact with the UI. My question is this:
I created a plain old Windows Form application (VS.NET 2005) with a
blank form, built it (release build), ran...
|
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 be updated to a form (only when this form exists), one form can be shown/created for each thread. Thought the forms might not exist, the threads will be always running.
I dont want to control the components (eg. labels) of the form from the threads...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |