473,396 Members | 1,996 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,396 software developers and data experts.

Displaying a form from thread plz help

4
Hi,

I ve searched these forums and found other people with simillar problems but havent found a clear solution. Your help would be appreciated...Here is my issues I have a multithreaded application with a dedicated UI thread (my main form) and another thread where i would like to display images completely independent of the UI thread. So i made form class called picForm and use the following code in my other thread:

picForm* newForm = new picForm();
picForm->Show();

The form freezes and doesnt respond. If i put this same code in my UI thread(main form) it does work. So i am thinking it has to do with the fact that I dont have a message pump in the other thread. But how do I create a message pump in the other thread becuase if I use application::run it is a blocking call (leaving that thread useless) and all i wanna do is display an image and forget about it and keep that pic form open until the user wants to close it.

What is the best way to do this ?? Sorry for the long post

thanks
Feb 20 '07 #1
2 1027
kenobewan
4,871 Expert 4TB
Does this article help? It uses a timer class:
Multithreading in .NET
Feb 22 '07 #2
jesh
4
Thanks for the reply I will look into this but really what i am doing is the following:

I wait for some packets in a thread that its not my UI thread.
Once i have al the packets I put them togather and it creates an image.
From this point I would like to display this image. In its own form and not block this thread so I can get more packets.

Right now if i create form .Show() doesnt work it will build in a window but then freeze. If i use showDialog() it will work but I will need to close the window to let the thread continue. I am assuming this happens cuz my other thread does not have a message pump. So i am not sure the best way around this problem...

Thanks
Feb 22 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dayne | last post by:
Briefly this is my problem . I created a windows form on a "parent thread" .. then I called a child thread 1 to make it visible then hide it on that same thread .. then kill child thread 1 ......
9
by: JW | last post by:
Dear NG, Still working on my .NET CF C# forms application ... I have an array of forms that I wish to display in array order, and thus have created a loop to run through them. Due to...
2
by: Dayne | last post by:
Briefly this is my problem . I created a windows form on a "parent thread" .. then I called a child thread 1 to make it visible then hide it on that same thread .. then kill child thread 1 ......
2
by: Dayne | last post by:
Briefly this is my problem . I created a windows form on a "parent thread" .. then I called a child thread 1 to make it visible then hide it on that same thread .. then kill child thread 1 ......
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
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...
0
agi2029
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,...

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.