473,503 Members | 2,159 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 2454
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.com
"Gaby" <le***@xs4all.nl> 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.com> wrote in
message news:ek*************@TK2MSFTNGP11.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.com
"Gaby" <le***@xs4all.nl> 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.nl> wrote in message
news:3f*********************@news.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.com> wrote in message news:ek*************@TK2MSFTNGP11.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.com
"Gaby" <le***@xs4all.nl> 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.com

"G Uljee" <le***@xs4all.nl> wrote in message
news:3f*********************@news.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.nl> wrote in message
news:3f*********************@news.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.com> wrote

in
message news:ek*************@TK2MSFTNGP11.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.com
"Gaby" <le***@xs4all.nl> 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.com> wrote in
message news:OQ******************@tk2msftngp13.phx.gbl...
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.com

"G Uljee" <le***@xs4all.nl> wrote in message
news:3f*********************@news.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.nl> wrote in message
news:3f*********************@news.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.com>
wrote in
message news:ek*************@TK2MSFTNGP11.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.com
>
>
> "Gaby" <le***@xs4all.nl> 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
5971
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...
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...
2
7555
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...
2
5270
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...
3
22834
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...
1
1747
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...
3
2286
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...
1
4479
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...
6
3499
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
1923
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...
0
7093
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...
1
7008
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
7467
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...
0
5594
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,...
0
3177
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...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
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 ...
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
399
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...

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.