473,788 Members | 2,857 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 1440
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
8393
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
2382
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
2040
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
9498
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
10175
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...
1
10112
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,...
0
9969
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...
1
7518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
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();...
0
5399
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...
1
4070
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
3
2894
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.