Ask a Question related to ASP.NET General, Design and Development.
-
Sreejumon [MVP] #1
PLS HELP: ActiveX control / apartment threading error
Hi,
If you want to use the activex controls in your asp.net
page, you ahev to use the single aprtment thread model.
For that please add the "aspcompat=true" attribute the
page directive.
Let me know the result.
Regards
Sreejumon
DOTNET makes IT happen
I'm using this>-----Original Message-----
>I am using an ActiveX control in a VB.NET user control.run the webform I>VB.NET user control inside of an ASP.NET webform. When I88cb-0020af6845f6'>get this error:
>Could not instantiate ActiveX control 'd940e4d2-6079-11ce-apartment.>because the current thread is not in a single-threadedthe internet):>
>In my VB.NET usercontrol I put this (after researching on><STAThread()> Public Sub Main()
> System.Threading.Thread.CurrentThread.ApartmentSta te =
>Threading.ApartmentState.STA
>End Sub
>
>Still get the same error. I know NOTHING about COM.
>
>Any ideas?
>
>Thanks,
>Robert
>
>
>.
>Sreejumon [MVP] Guest
-
User Control and ActiveX control
Now I am hosting a user control(an assembly in .dll) in IE. I want to know the difference between this kind of control and ActiveX control. thank... -
Namespace for apartment threading modules ?
Looking for namespace advice... After building a specialized set of classes to support apartment threading of DBI... -
Using MFC ActiveX control in ASP
I'm using VS.Net 2003 to create a very simple ActiveX control in MFC. The control has no ui and just a few properties and methods. What do I... -
Threading model to 'Any Apartment'
Hey guys, i am relatively new to this COM+ thing, i am trying to figure out where do i set the threading model for my application as 'any... -
ActiveX control on ASP.NET Web Form Runtime Error
Hi, I am trying to add an ActiveX control on my ASP.NET web form (the language for code behind is C#). I have some client-side vbscript to... -
Alvin Bruney #2
Re: PLS HELP: ActiveX control / apartment threading error
try manually re-registering the component again.
this seems to be a registration problem before being a thread problem unless
you are doing some complex stuff
"VB Programmer" <growNO-SPAM@go-intech.com> wrote in message
news:OPbE7VZRDHA.2148@TK2MSFTNGP11.phx.gbl...I> I am using an ActiveX control in a VB.NET user control. I'm using this
> VB.NET user control inside of an ASP.NET webform. When I run the webform'd940e4d2-6079-11ce-88cb-0020af6845f6'> get this error:
> Could not instantiate ActiveX control> because the current thread is not in a single-threaded apartment.
>
> In my VB.NET usercontrol I put this (after researching on the internet):
> <STAThread()> Public Sub Main()
> System.Threading.Thread.CurrentThread.ApartmentSta te =
> Threading.ApartmentState.STA
> End Sub
>
> Still get the same error. I know NOTHING about COM.
>
> Any ideas?
>
> Thanks,
> Robert
>
>
Alvin Bruney Guest
-
VB Programmer #3
Re: PLS HELP: ActiveX control / apartment threading error
Thanks for your response.
The good news is that I don't get that error anymore after adding that
directive to my aspx page. The bad news is that my user control (created in
VB.NET & contains the non-managed ActiveX control) doesn't show up on the
page. In fact, at design time it shows up at the bottom of the webform, I
guess because I dont have a "custom designer" or something.
Any ideas why this control doesn't show up?
"Sreejumon [MVP]" <sreeju_uss@hotmail.com> wrote in message
news:060101c3459f$eb15d8e0$a301280a@phx.gbl...> Hi,
>
> If you want to use the activex controls in your asp.net
> page, you ahev to use the single aprtment thread model.
> For that please add the "aspcompat=true" attribute the
> page directive.
>
> Let me know the result.
>
> Regards
> Sreejumon
> DOTNET makes IT happen
>> I'm using this> >-----Original Message-----
> >I am using an ActiveX control in a VB.NET user control.> run the webform I> >VB.NET user control inside of an ASP.NET webform. When I> 88cb-0020af6845f6'> >get this error:
> >Could not instantiate ActiveX control 'd940e4d2-6079-11ce-> apartment.> >because the current thread is not in a single-threaded> the internet):> >
> >In my VB.NET usercontrol I put this (after researching on> ><STAThread()> Public Sub Main()
> > System.Threading.Thread.CurrentThread.ApartmentSta te =
> >Threading.ApartmentState.STA
> >End Sub
> >
> >Still get the same error. I know NOTHING about COM.
> >
> >Any ideas?
> >
> >Thanks,
> >Robert
> >
> >
> >.
> >
VB Programmer Guest



Reply With Quote

