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 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
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
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
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
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 > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
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...
| |
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...
|
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...
|
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,...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |