473,626 Members | 3,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could not instantiate ActiveX control because the current thread is not in a si

Getting "Could not instantiate ActiveX control because
the current thread is not in a single-threaded
apartment. " error while using AxMSComLib control.

I am working on a Web Application. My soultion has 3
projects in it. One of the project is using AXMSComLib.
Since this is web application I count find any Main()
method to add [STAThread].
I did add before the instance of the object AxMSComLib:
"Thread.Current Thread.Apartmen tState = ApartmentState. STA;"
Its not working. Any help will be really appreciated.
Nov 12 '05 #1
0 920

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

Similar topics

0
2505
by: Karthey | last post by:
Getting "Could not instantiate ActiveX control because the current thread is not in a single-threaded apartment. " error while using AxMSComLib control. I am working on a Web Application. My soultion has 3 projects in it. One of the project is using AXMSComLib. Since this is web application I count find any Main() method to add . I did add before the instance of the object AxMSComLib: "Thread.CurrentThread.ApartmentState =...
5
2461
by: Gaby | last post by:
Hi, I try to create a windows from with an ocx on it. When I call the form after a click event of a button it works fine. But when I try want to create the form based on some information from a MSMQ I get the message similar as the subject of this message. I've already changed my app to Single Thread :
3
2318
by: fumihiko | last post by:
Hi, I created an activex control (C++), and it uses another COM dll (C++). This COM dll links with a static library that dose some calculation. (both are debug multithreaded dll) I created a C# client having activex control embedded at the very beginning (added in the design window); then, I created another same activex control at the runtime. After the 2nd activex control is created, I start to get errors on the function calls to the...
5
5695
by: Yeti | last post by:
Hey everyone, I am modifying code upgraded from VB 6 to 2005. I need to run the 2005 code in the MTA mode so I set a sub main procedure in my module which runs first when the program starts: Public theApplicationForm As New Form1 <MTAThread()> Public Sub main() Application.Run(theApplicationForm) End Sub
0
8203
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
8642
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
8512
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
6125
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
5576
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
4094
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
4206
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2630
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
1
1815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.