473,770 Members | 5,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mixing MTAThread with STAThread

1 New Member
I am working on a C# project which uses some DCOM components that work in multithreaded mode. So using [MTAThread] works for this reason. However, this disables some other user interface components which require it to be STA. Does anyone have any recommendations how can one mix the two modes to makes all the components work?

All help is greatly appreciated.

Thanks,
SF
Nov 14 '07 #1
0 1240

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

Similar topics

0
2722
by: sonu | last post by:
Hi I have developed a smart client application. When i try to execute it. It displays the first form which is the login screen. On giving the corrent login id and password, the main form opens. It has 2 menus. On clicking the submenu, it throws an STAThread exception. The error details are given below. I have included System.Threading.Thread.CurrentThread.ApartmentState =
11
43200
by: warren | last post by:
Hello, Anyone can brief me what is this in front of the Main method for? and when must it be there, and when is it optional? thank you.
3
2188
by: Justine | last post by:
hi all, i just want to know the significance of in the C# application. Why & for What reason is this used. Thanz in Advance, Justine
1
8428
by: Alberto | last post by:
What's the meaning of the STAThread attribute? Thanks
15
21325
by: Brett | last post by:
C# code automatically generates or references. Single or Multi apartment threads. What exacty does this do and what will happen if I remove it? Is MTAThread necessary if I want to use multiple threads in my app? Also, why doesn't VB use STA or MTA thread? Thanks, Brett
9
1490
by: Pascal Cloup | last post by:
Hello, I write a Dll of managed C++ class that contains a piece of code like the following liines. This code always fails when attempting to create a new not managed class. Someone has an explanation? Help please Pascal
1
2519
by: Erik | last post by:
Where is the "MTAThread()" method? I'm writing a service in VB.Net. Being of a curious nature, I looked at the generated code, which has the following: > <MTAThread()> _ > Shared Sub Main() > ' stuff deleted > End Sub
28
3100
by: ziman137 | last post by:
Hello all, I have a question and am seeking for some advice. I am currently working to implement an algorithmic library. Because the performance is the most important factor in later applications, I decide to write it in C instead of C++. However, I thought it might be convenient to use some C++ code at some misc places. I'm aware that, I could always use the C++ compiler to get it work.
12
5064
by: rafalK | last post by:
Hi All, I have a big problem with STAThread attribute. I'm using XNA framework connected with WinForms. XNA is working in non STAThread. I have a problem with displaying CommonDialog forms e.g. OpenFileDialog. I can't declare a main method as STAThread because of XNA framework. Is there any way to declare form or some method in form as STAThread (I think that a method from Form can invoke OpenFileDialog) maybe I'm wrong. Do you know...
0
9592
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
10058
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
10004
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
9870
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
5313
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...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
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
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
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.