473,800 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Threading - Merging a spawned thread with the main thread

I'm having a major problem with threads.

I have a main application that dynamically loads plugins. One of the
plugins receives SMS messages in a seperate thread. When an SMS comes in I
need to display an MDI Child form within the Main Application workspace. The
code bombs out when I attempt to assign the MDIParent of the child form to
the Main Form (in the main thread). Some how I need to merge the spawned
thread with the main thread before creating the child form.... any ideas?

I know Invoke() can be used for GUI controls, but I can't use this as I'm
creating the form from a class that is not a Form..!?!?

Thanks
Threading - Merging a spawned thread with the main thread
Jul 21 '05 #1
1 1441
Neds wrote:
I'm having a major problem with threads.

I have a main application that dynamically loads plugins. One of the
plugins receives SMS messages in a seperate thread. When an SMS comes in
I
need to display an MDI Child form within the Main Application workspace.
The code bombs out when I attempt to assign the MDIParent of the child
form to
the Main Form (in the main thread). Some how I need to merge the spawned
thread with the main thread before creating the child form.... any ideas?
..Join() ?

I know Invoke() can be used for GUI controls, but I can't use this as I'm
creating the form from a class that is not a Form..!?!?

Thanks
Threading - Merging a spawned thread with the main thread


--
Texeme
http://texeme.com

Jul 21 '05 #2

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

Similar topics

8
8395
by: Ivan Nestlerode | last post by:
Hello comp.lang.python, I am attempting to write a threaded program right now in Python (version 2.3 on Debian unstable) and the current behavior of KeyboardInterrupt is causing me grief. From the documentation of the thread module in Python 2.3.3: "Threads interact strangely with interrupts: the KeyboardInterrupt exception will be received by an arbitrary thread. (When the signal module is available, interrupts always go to the main...
2
2383
by: Christopher J. Bottaro | last post by:
Hello, I'm trying to write a fairly simple network program. The main thread spawns a thread which creates a listener socket and then calls socket.accept on it. socket.accept blocks indefinantly. My problem is that when the main thread determines that it is time to quit, how do I get the spawned thread to exit? Preferably I'd like the spawned thread to return from socket.accept when the main thread tells it to and then check a shared...
7
393
by: Tom B | last post by:
I've written the code below to try and figure out how threading works. My assumption is that when starting a new thread it would run at the same time as the original thread. Am I wrong? I've made a simple form with two text labels and a button. When I click the button, it creates a thread that updates one label, and the main code updates the other label. It appears that the created thread doesn't run until the main thread is
1
1695
by: Ray Ackley | last post by:
I'm experiencing a threading problem that's really perplexing me. I have a multithreaded application that reads car ECU information that's sent over the serial port by the ECU and received by the laptop/program. I'll try to give a concise synopsis as the program is easily 10k+ lines. main.cs - contains the application start function. Here's the entire code (minus misc junk) as it's rather small -
13
371
by: RCS | last post by:
I have a UI that needs a couple of threads to do some significant processing on a couple of different forms - and while it's at it, update the UI (set textboxes, fill in listviews). I created a base class for the worker class, and made up some functions/delegates to handle the invoke stuff for the UI and that was fine for a prototype. I rewrote this chunk, broke things out into different classes - but the threading is still the same - and...
5
2041
by: Robert W. | last post by:
I'm creating a WinForms app that will act as a companion (think administrator functionality) to a Pocket PC app. Generally the WinForms app works under just the UI thread. But if a Pocket PC connects to the desktop via ActiveSync then a separate thread is spawned. In addition to the main desktop app window I also have a Notification form that appears in the lower right of the screen and provides feedback to the user about what is...
1
1364
by: Brad Brening | last post by:
I am building a class that has a function that I would like to run asycronously. When the function is complete I would like to notify the calling thread by raising an event or using a delegate. The handler for the event (or the delegate callback) should run in the parent thread - not on the asyncronous thread created while the function ran. So, basically, I want my parent (form, class, control) to call my class function - which spawns a...
1
279
by: Neds | last post by:
I'm having a major problem with threads. I have a main application that dynamically loads plugins. One of the plugins receives SMS messages in a seperate thread. When an SMS comes in I need to display an MDI Child form within the Main Application workspace. The code bombs out when I attempt to assign the MDIParent of the child form to the Main Form (in the main thread). Some how I need to merge the spawned thread with the main thread...
7
297
by: Tim | last post by:
Hi, I have developed a windows forms application that works fine on a single thread. Part of the requirements of this app is that it monitors the status of a couple of services. So I think that the best way to do this is on a separate thread. It will check every 60 seconds or so to make sure the services are still running. First of all is this the best way? Second assuming that it is can
0
9690
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, 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...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10504
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10274
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
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 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...
0
9085
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, 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...
0
5469
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...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.