By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,905 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,905 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.