Creating a window in a new thread

  • Thread starter Thread starter Joshua Ellul
  • Start date Start date
J

Joshua Ellul

Hi There,

I want to create a window in a thread of its own how can I do this?

Regards,

Joshua
 
Hi, Joshua

You can do that in exactly same way as you do on main UI thread.
Basically this means you have to create Form and use Application.Run on it.
This will start separate message pump for your thread.
At the same time you must keep in mind that communication and
synchronization between UI threads is not so simple as when you have only
one UI thread. See Invoke/BeginInvoke methods for resp. controls and
threading topics in MSDN for .Net.

HTH
Alex
 
* "AlexS said:
You can do that in exactly same way as you do on main UI thread.
Basically this means you have to create Form and use Application.Run on it.
This will start separate message pump for your thread.
At the same time you must keep in mind that communication and
synchronization between UI threads is not so simple as when you have only
one UI thread. See Invoke/BeginInvoke methods for resp. controls and
threading topics in MSDN for .Net.

Mhm... I still would try to avoid that and create the UI in the main
thread and then use invoke to communicate with the UI.
 
The problem is that I have an ActiveX component created in VB, in which I
need to make several instances of the component in different threads. Is it
possible to instantiate a component without adding it to a form?

Josh
 
Back
Top