Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > PLS HELP: ActiveX control / apartment threading error

Reply
Thread Tools

PLS HELP: ActiveX control / apartment threading error

 
 
Sreejumon [MVP]
Guest
Posts: n/a
 
      07-08-2003
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

>-----Original Message-----
>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 I
>get this error:
>Could not instantiate ActiveX control 'd940e4d2-6079-11ce-

88cb-0020af6845f6'
>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
>
>
>.
>

 
Reply With Quote
 
 
 
 
VB Programmer
Guest
Posts: n/a
 
      07-09-2003
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]" <(E-Mail Removed)> wrote in message
news:060101c3459f$eb15d8e0$(E-Mail Removed)...
> 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
>
> >-----Original Message-----
> >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 I
> >get this error:
> >Could not instantiate ActiveX control 'd940e4d2-6079-11ce-

> 88cb-0020af6845f6'
> >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
> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX control in python vs ActiveX control in vb 6 (piece of code) vml Python 0 08-22-2007 09:57 AM
Session Variables holding VB COM objects (Apartment Threading) Andy Kasotia ASP General 4 12-09-2005 06:01 PM
ActiveX apologetic Larry Seltzer... "Sun paid for malicious ActiveX code, and Firefox is bad, bad bad baad. please use ActiveX, it's secure and nice!" (ok, the last part is irony on my part) fernando.cassia@gmail.com Java 0 04-16-2005 10:05 PM
Re: Setting up a wireless network in an apartment block Jeff Durham Wireless Networking 3 09-18-2004 01:02 PM
Re: PLS HELP: ActiveX control / apartment threading error Alvin Bruney ASP .Net 0 07-09-2003 05:14 AM



Advertisments