473,563 Members | 2,696 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could not instantiate ActiveX control 'cdec3246-f5f1-41ce-87b2-c74e81fc1a39' bec

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 :
[STAThread]
public static void Main()
{
Application.Run (MainForm);
}

Any idea?

Cheers, Gaby
Nov 15 '05 #1
5 2459
Gaby,

How are you creating it from the information in MSMQ? What are you
using? Are you sure that the control that you are creating (in the OCX, not
the interop assembly) is installed properly (or at all) on the machine
receiving the message? If you are using an ActiveX control, you have to
make sure it is installed properly on the machine that you are using it on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Gaby" <le***@xs4all.n l> wrote in message
news:07******** *************** *****@phx.gbl.. .
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 :
[STAThread]
public static void Main()
{
Application.Run (MainForm);
}

Any idea?

Cheers, Gaby

Nov 15 '05 #2
Nicholas,

I create the form like the standard way;

private void ShowSingleForm( )
{
FrmSingle Frm = new FrmSingle(this) ;
}

I call the procedure ShowSingleForm( ) when a specific message is passing by.
I've no problems with the MSQM only with the form.
The strange thing is when I call ShowSingleForm( ) under a click event from a
button I don't have the problem.

I've found some related articles but all the articles say that I must switch
from mult to single threading with [STAThread] but on my case that's not the
solution.

any idea?

Gaby

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:ek******** *****@TK2MSFTNG P11.phx.gbl...
Gaby,

How are you creating it from the information in MSMQ? What are you
using? Are you sure that the control that you are creating (in the OCX, not the interop assembly) is installed properly (or at all) on the machine
receiving the message? If you are using an ActiveX control, you have to
make sure it is installed properly on the machine that you are using it on.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Gaby" <le***@xs4all.n l> wrote in message
news:07******** *************** *****@phx.gbl.. .
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 :
[STAThread]
public static void Main()
{
Application.Run (MainForm);
}

Any idea?

Cheers, Gaby


Nov 15 '05 #3
This the comple error message:

Could not instantiate ActiveX control 'cdec3246-f5f1-41ce-87b2-c74e81fc1a39'
because the current thread is not in a single-threaded apartment.
"G Uljee" <le***@xs4all.n l> wrote in message
news:3f******** *************@n ews.xs4all.nl.. .
Nicholas,

I create the form like the standard way;

private void ShowSingleForm( )
{
FrmSingle Frm = new FrmSingle(this) ;
}

I call the procedure ShowSingleForm( ) when a specific message is passing by. I've no problems with the MSQM only with the form.
The strange thing is when I call ShowSingleForm( ) under a click event from a button I don't have the problem.

I've found some related articles but all the articles say that I must switch from mult to single threading with [STAThread] but on my case that's not the solution.

any idea?

Gaby

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in message news:ek******** *****@TK2MSFTNG P11.phx.gbl...
Gaby,

How are you creating it from the information in MSMQ? What are you
using? Are you sure that the control that you are creating (in the OCX,

not
the interop assembly) is installed properly (or at all) on the machine
receiving the message? If you are using an ActiveX control, you have to
make sure it is installed properly on the machine that you are using it

on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Gaby" <le***@xs4all.n l> wrote in message
news:07******** *************** *****@phx.gbl.. .
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 :
[STAThread]
public static void Main()
{
Application.Run (MainForm);
}

Any idea?

Cheers, Gaby



Nov 15 '05 #4
Gaby,

Are you creating/showing the form in a thread other than the main UI
thread? All UI operations should occur in the main UI thread for the
process.

Chances are you are creating the form in a separate thread and that the
thread you are doing it on is not a single threaded apartment thread.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"G Uljee" <le***@xs4all.n l> wrote in message
news:3f******** *************@n ews.xs4all.nl.. .
This the comple error message:

Could not instantiate ActiveX control 'cdec3246-f5f1-41ce-87b2-c74e81fc1a39' because the current thread is not in a single-threaded apartment.
"G Uljee" <le***@xs4all.n l> wrote in message
news:3f******** *************@n ews.xs4all.nl.. .
Nicholas,

I create the form like the standard way;

private void ShowSingleForm( )
{
FrmSingle Frm = new FrmSingle(this) ;
}

I call the procedure ShowSingleForm( ) when a specific message is passing by.
I've no problems with the MSQM only with the form.
The strange thing is when I call ShowSingleForm( ) under a click event from a
button I don't have the problem.

I've found some related articles but all the articles say that I must

switch
from mult to single threading with [STAThread] but on my case that's not

the
solution.

any idea?

Gaby

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote

in
message news:ek******** *****@TK2MSFTNG P11.phx.gbl...
Gaby,

How are you creating it from the information in MSMQ? What are you using? Are you sure that the control that you are creating (in the OCX, not
the interop assembly) is installed properly (or at all) on the machine
receiving the message? If you are using an ActiveX control, you have
to make sure it is installed properly on the machine that you are using

it on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
"Gaby" <le***@xs4all.n l> wrote in message
news:07******** *************** *****@phx.gbl.. .
> 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 :
> [STAThread]
> public static void Main()
> {
> Application.Run (MainForm);
> }
>
> Any idea?
>
> Cheers, Gaby



Nov 15 '05 #5
Nicholas,

You're right, I started a second thread cheers for your help.

Gaby
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:OQ******** **********@tk2m sftngp13.phx.gb l...
Gaby,

Are you creating/showing the form in a thread other than the main UI
thread? All UI operations should occur in the main UI thread for the
process.

Chances are you are creating the form in a separate thread and that the thread you are doing it on is not a single threaded apartment thread.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"G Uljee" <le***@xs4all.n l> wrote in message
news:3f******** *************@n ews.xs4all.nl.. .
This the comple error message:

Could not instantiate ActiveX control 'cdec3246-f5f1-41ce-87b2-c74e81fc1a39'
because the current thread is not in a single-threaded apartment.
"G Uljee" <le***@xs4all.n l> wrote in message
news:3f******** *************@n ews.xs4all.nl.. .
Nicholas,

I create the form like the standard way;

private void ShowSingleForm( )
{
FrmSingle Frm = new FrmSingle(this) ;
}

I call the procedure ShowSingleForm( ) when a specific message is passing
by.
I've no problems with the MSQM only with the form.
The strange thing is when I call ShowSingleForm( ) under a click event from
a
button I don't have the problem.

I've found some related articles but all the articles say that I must

switch
from mult to single threading with [STAThread] but on my case that's
not the
solution.

any idea?

Gaby

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om>
wrote in
message news:ek******** *****@TK2MSFTNG P11.phx.gbl...
> Gaby,
>
> How are you creating it from the information in MSMQ? What are

you > using? Are you sure that the control that you are creating (in the OCX, not
> the interop assembly) is installed properly (or at all) on the
machine > receiving the message? If you are using an ActiveX control, you

have to > make sure it is installed properly on the machine that you are using it on.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mv*@spam.guard. caspershouse.co m
>
>
> "Gaby" <le***@xs4all.n l> wrote in message
> news:07******** *************** *****@phx.gbl.. .
> > 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 :
> > [STAThread]
> > public static void Main()
> > {
> > Application.Run (MainForm);
> > }
> >
> > Any idea?
> >
> > Cheers, Gaby
>
>



Nov 15 '05 #6

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

Similar topics

1
5972
by: wang xiaoyu | last post by:
Hello: i want use activex in wxpython program,but when i use MakeActiveXClass an exception occurs. this is my source code dealing the DICOM ocx.I must note that in this program "hwtxcontrol" is a ocx developed my me use vc6,this ocx works fine in wxpython. but you can see i only change this ocx with a new DICOM ocx and set up eventClass,
0
2500
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...
2
7558
by: Fie Fie Niles | last post by:
This one XP machine (with IE 6) is having a problem viewing any ActiveX controls (created on VB6) on the Internet Explorer browser. I put the same ActiveX control in a VB program, and when I run the VB program on that same machine, I can view the ActiveX control fine. He is using Citrix. The same ActiveX controls can be viewed on other...
2
5298
by: Berata | last post by:
Hello all, in VB6 we were able to create ActiveX-DLL's (In Process Components) and ActiveX-Exe's (Out of Process Components). We habe build up an application that exists of an main module (Standard Exe) that calls and controls other modules (ActiveX-Exe). We decided for ActiveX-Exe because they run in different processes. That means if...
3
22841
by: EJ1003 | last post by:
Hello I would like to create Activex Control uisng C# and use it in ASP.Net webform. User Control is not solving my requirement so I am going for Activex Control. Please guide me on this, how to do it, if any sample is provided will be of great help Thanks EJ
1
1756
by: Anand Kale | last post by:
How to have ActiveX control called from Web Form in ASP.Net ? ActiveX control is written using VC++/MFC/ATL-COM. Also kindly answer following issues, 1. Also how to take care of issues about security etc ? 2. Can anyone give me exact steps to embedd activex in a web form ? 3. Can the activeX control interact with the server side control on...
3
2288
by: Weston Fryatt | last post by:
Simple question I hope.... How do I send data to and from an ASP.Net (server side) web page to a ActiveX Control (client side) embedded in a web browser??? What I need to do, is I have image data (mostly TIFF format) that need to be sent to our custom Image Viewer (ActiveX control). So far I can get the TIFF image data loaded into a...
1
4489
by: jmi0 | last post by:
I want to create a custom user control to be used in a web page (by object tag) as an assembly. The user control needs to have a web browser control in it. Having tried with the managed System.Windows.Forms.WebBrowser or AxSHDocVw.AxWebBrowser, none of them worked from IE invocation unfortunately. While System.Windows.Forms.WebBrowser...
6
3505
by: Budhi Saputra Prasetya | last post by:
Hi All, I'm trying to display .NET Custom Control (created using Inherited Control) on an ASPX page, but no luck. I already registered the Control to Global Assembly Cache through .NET Framework 1.1 Configuration. I have also put a reference to the control on my ASP .NET project. The view that I get is only a disabled text area. Below is...
1
1928
by: Jialiang Ge [MSFT] | last post by:
Hello Philippe, In addition to bruce's points, I'd suggest the KB article http://support.microsoft.com/kb/317392. It demonstrates how to host an ActiveX control in ASP.NET (for your first question), and points out that ActiveX control is a pure client-side control, the server-side code cannot access this control (for your second question)....
0
7664
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...
0
7583
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...
0
7948
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...
0
6250
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3642
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
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
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
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...

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.