469,609 Members | 1,657 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Enabling STAThreadAttribute

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
May 8 '06 #1
3 1344
I've solved this now sorry, this thread may be deleted.

Adam

"Adam Honek" <Ad*******@Webmaster2001.freeserve.co.uk> wrote in message
news:Ou**************@TK2MSFTNGP03.phx.gbl...
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

May 8 '06 #2
"Adam Honek" <Ad*******@Webmaster2001.freeserve.co.uk> schrieb:
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?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 8 '06 #3
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

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:OM**************@TK2MSFTNGP02.phx.gbl...
"Adam Honek" <Ad*******@Webmaster2001.freeserve.co.uk> schrieb:
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?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

May 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Prem Soman | last post: by
2 posts views Thread by Chakkaradeep | last post: by
2 posts views Thread by HumptyDumpty | last post: by
2 posts views Thread by Chandrakant Shinde | last post: by
2 posts views Thread by Roy Gunnarsson | last post: by
10 posts views Thread by SAL | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.