Enabling STAThreadAttribute

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
 
H

Herfried K. Wagner [MVP]

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?
 
A

Adam Honek

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
 

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

Top