|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Class Not registered on STA Thread with ActiveX Controlon 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
Show quote
"Shahzad Godil" <shahzadgo***@gmail.com> wrote in message [attached file: ThreadCheck.zip]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 > > |
|||||||||||||||||||||||