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

show a form from a thread

Hi,

I am developing a desktop chat application using vb.net.
My design is as follows :

1. Have a login form
2. Have a contacts form
3. Have a chat form

The chat form should be opened at runtime depending upon my chat server response. I should always listen for the response from the server and open the form.
I written a function which will listen for the response and trying a open the chat form. I am calling this function in a thread. I always get the error that i cannot open a form from the thread. I get the folloeing error.

ActiveX control '<GUID>' cannot be instantiated because the current thread is not in a single-threaded apartment.

How can i solve this.

Your help is very much required.

Thanks,
Dev.
Dec 24 '08 #1
1 1366
Frinavale
9,735 Expert Mod 8TB
I think I know what's happening: it's how you are calling the function in the thread. You need to reorganize your application so that it uses a Single-Thread Apartment for your Chat window.

What language are you using to implement your solution?

-Frinny
Dec 30 '08 #2

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

Similar topics

2
by: Zzzbla | last post by:
Hello, I'm writing a reminders project and I've been having some difficulties. It starts with a simple class that contains a timer and NotifyIcon, where the main function initializes the timer...
4
by: Altramagnus | last post by:
I have a form first created my the main thread. I have another thread monitoring the IO. Upon receiving certain message, I want to show/unhide the form. When the form is first created ( handle...
8
by: MV | last post by:
Why can't I run .Show() on a System.Windows.Forms object from a Class? The code works fine if i run it from an other form. The form gets visible but no controls are loaded and the mouse pointer...
7
by: Pi | last post by:
I have an MDI parent with one or more children forms. Each child form has an engine thread that processes data. The child form's _Closing event is roughly 01 Private Sub...
8
by: PAPutzback | last post by:
How do I keep the form up.
4
by: DBC User | last post by:
Hi, I have windows form program. While that form is building to show, I want to show another window (kinda splash screen so I can show the user the program is loading..) Can someone suggest a...
3
by: Robert Dufour | last post by:
I have an app with code that continuously executes on a form in a timer control. I also need to show another form without interrupting the code executing in this timer. I suspect that to do that I...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
4
by: Gaz | last post by:
I am having a bit of a problem getting my application to work properly. RIght here is my problem... WHen my C# windows app loads up the start form, i create a new thread and show the splash...
6
by: akshaycjoshi | last post by:
There are some textboxes placed on a form along with one button.When the user presses the button a modal window pops up till the work is finished and that window shows that circling processing GIF...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.