Enabling STAThreadAttribute

  • Thread starter Thread starter Adam Honek
  • Start date Start date
A

Adam Honek

How would I enable STAThreadAttribute in my Main function.

I assume the error means Sub Main().

Apparently this may fix my openfiledialog error so it's worth a go.

Thanks,
Adam
 
Adam Honek said:
I've solved this now sorry, this thread may be deleted.

I'd still try to determine the reason for 'MTAThread' being used. Are you
using any old COM components within your application?
 
Old as in?

It's all .NET 2.0 as far as I can tell.

The only "older" components that possibly use COM and are on my forms are

TreeView
ListView
StatusLabel
RichTextBox
Timer

I didn't set 'MTAThread' by default, this seems to be the default setting
when a
thread is launched in the application.

Adam
 
Back
Top