Home All Groups Group Topic Archive Search About

Class Not registered on STA Thread with ActiveX Control

Author
5 Jul 2006 10:56 AM
Shahzad Godil
I have one remoting server which is launch Visio activex based application
on remote request.

I have this code to launch my application.  But it is giving "Class Not
registered" error in InitializeComponent of form which has ActiveX control.
My application is working perfectly when I am launching this without any
thread.

I also tried Appartment.STA to MTA but it is also failing because activex
control doesnt support mta.

Please suggest.

Thanks
Shahzad Godil

Public Sub LaunchThread()

' Create a thread. Then run the LaunchForm method on the thread.

Dim MyThread As System.Threading.Thread

MyThread = New System.Threading.Thread(AddressOf LaunchForm)

MyThread.ApartmentState = Threading.ApartmentState.STA

MyThread.Start()

End Sub

Author
5 Jul 2006 1:06 PM
Shahzad Godil
Show quote
"Shahzad Godil" <shahzadgo***@gmail.com> wrote in message
news:%23UqC8nCoGHA.1208@TK2MSFTNGP04.phx.gbl...
>
> I have one remoting server which is launch Visio activex based application
> on remote request.
>
> I have this code to launch my application.  But it is giving "Class Not
> registered" error in InitializeComponent of form which has ActiveX
> control.
> My application is working perfectly when I am launching this without any
> thread.
>
> I also tried Appartment.STA to MTA but it is also failing because activex
> control doesnt support mta.
>
> Please suggest.
>
> Thanks
> Shahzad Godil
>
> Public Sub LaunchThread()
>
> ' Create a thread. Then run the LaunchForm method on the thread.
>
> Dim MyThread As System.Threading.Thread
>
> MyThread = New System.Threading.Thread(AddressOf LaunchForm)
>
> MyThread.ApartmentState = Threading.ApartmentState.STA
>
> MyThread.Start()
>
> End Sub
>
>

[attached file: ThreadCheck.zip]

AddThis Social Bookmark Button