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

  • Thread starter Thread starter Gaby
  • Start date Start date
G

Gaby

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
 
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,



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 said:
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]
- (e-mail address removed)


Gaby said:
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
 
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 said:
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



message news:[email protected]...
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]
- (e-mail address removed)


Gaby said:
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
 
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]
- (e-mail address removed)

G Uljee said:
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 said:
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



message news:[email protected]...
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]
- (e-mail address removed)


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
 
Nicholas,



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



Gaby


Nicholas Paldino said:
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]
- (e-mail address removed)

G Uljee said:
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 said:
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]" <[email protected]>
wrote
in
message 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]
- (e-mail address removed)


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
 
Back
Top