web browser in RC

  • Thread starter Thread starter thomasp
  • Start date Start date
T

thomasp

I have a windows form that was built in VB2005 Beta2 that contains three web
browser controls. It worked fine in VB Beta2 but in the RC is gives the
following error:

An error occurred creating the form. See Exception.InnerException for
details. The error is: ActiveX control
'8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the
current thread is not in a single-threaded apartment.

Can someone point me in the right direction to solve this problem?

Thanks,

Thomas
 
Dear Thomas,

You should put the [STAThread] attribute on the Main() in order to run in
STA.

Hope this will solve your problem,

Michel van den Berg
 
Dear Thomas,

ofcours we can!

<STAThread()>
Shared Sub Main()
Application.Run(New HelloFrm())
End Sub

However, please note, that with some clicks in google, you could easily find
this info too.

Michel van den Berg
 
Thanks for the reply. My project starts with a splashscreen form, but I
guess all I have to do is add a sub main and start with it. I will give
this a try.

Thanks,

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top