473,404 Members | 2,174 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,404 software developers and data experts.

Controls created on one thread cannot (inoke setup)

What is the best way to re-write this code to avoid the
'Controls created on one thread cannot be parented to a control on a
different thread.' error?
Private Sub SendCMTStoCore(ByVal Cmts As String)
Dim threadMillhouseBridge As New
MillhouseCore.ShowCMTSBridge(Cmts, AddressOf FormatReturnCMTSInfo)
Dim threadCMTSScan As New Thread(AddressOf
threadMillhouseBridge.BeginCMTSScan)
threadCMTSScan.Name = intThreadCounterMill.ToString

threadCMTSScan.Start()
intThreadCounterMill += 1
End Sub

Nov 21 '05 #1
1 1088
Create both controls on the same thread? Or, create the controls on the
main process thread; create threads to do whatever work they are supposed to
do and use delegates to invoke methods on the controls.

"pmclinn" <pm*****@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
What is the best way to re-write this code to avoid the
'Controls created on one thread cannot be parented to a control on a
different thread.' error?
Private Sub SendCMTStoCore(ByVal Cmts As String)
Dim threadMillhouseBridge As New
MillhouseCore.ShowCMTSBridge(Cmts, AddressOf FormatReturnCMTSInfo)
Dim threadCMTSScan As New Thread(AddressOf
threadMillhouseBridge.BeginCMTSScan)
threadCMTSScan.Name = intThreadCounterMill.ToString

threadCMTSScan.Start()
intThreadCounterMill += 1
End Sub

Nov 21 '05 #2

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

Similar topics

2
by: avivgur | last post by:
Hello, I am writing a program in Visual C# and I have encountered a problem. In my program I want to dynamically create a multitude of controls (thousands) on a form. The problem is that calling...
10
by: jaire | last post by:
In my application I have two threads. Each of them creates a new propertygrid. In the property grid I have a property with a color editor. Whenever i am clicking on the combo box to change the...
2
by: Ludovic SOEUR | last post by:
Have everyone tried to create controls in separated threads ? I have a problem that I do not understand. To simplify the explanations, I wrote theses few lines to show an example of the problem....
1
by: VMI | last post by:
Im using a separate thread in my code to copy a huge file, but I get the "Controls created on one thread cannot be parented to a control on a different thread" when I want to update the Form...
3
by: Arthur Dzhelali | last post by:
I am trying dynamically create controls and add them to the form on the Separate thread. I know that I have to use delegate in order to update preexisting controls on the form, but when I ma...
2
by: Olaf Rabbachin | last post by:
Hi folks, I have a form in which I'm starting a separate thread (which is searching directories for image-files and generating thumbnails of them in different dir). Within the form, I also have...
1
by: CharChabil | last post by:
Hello Guys, I am trying to mark locations on a map (x,y pixels are derived from a DB) This is the code that i am using Private Sub DisplayOnSoftMap() SqlQuey = "Select * FROM SoftwareMap WHERE...
3
by: ohmmega | last post by:
since its common knowledge that it's not possible to hide a tabcontrol tab, i made a collection for removed pages including their tabcontrols. removing works pretty fine, but whenever i try to add...
7
by: kimiraikkonen | last post by:
Hello experts, I've been already working on a project and also asked and i've managed to create a basic Gmail mail sender, but i want to add a progressbar that shows "sending is in progress" but...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...

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.