Enabling STAThreadAttribute

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Adam Honek

    #1

    Enabling STAThreadAttribute

    How would I enable STAThreadAttrib ute 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

    #2
    Re: Enabling STAThreadAttrib ute

    I've solved this now sorry, this thread may be deleted.

    Adam

    "Adam Honek" <AdamHonek@Webm aster2001.frees erve.co.uk> wrote in message
    news:OubnycocGH A.4108@TK2MSFTN GP03.phx.gbl...[color=blue]
    > How would I enable STAThreadAttrib ute 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
    >[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Enabling STAThreadAttrib ute

      "Adam Honek" <AdamHonek@Webm aster2001.frees erve.co.uk> schrieb:[color=blue]
      > I've solved this now sorry, this thread may be deleted.[/color]

      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/>

      Comment

      • Adam Honek

        #4
        Re: Enabling STAThreadAttrib ute

        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]" <hirf-spam-me-here@gmx.at> wrote in message
        news:OMtlXrrcGH A.3632@TK2MSFTN GP02.phx.gbl...[color=blue]
        > "Adam Honek" <AdamHonek@Webm aster2001.frees erve.co.uk> schrieb:[color=green]
        >> I've solved this now sorry, this thread may be deleted.[/color]
        >
        > 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/>[/color]


        Comment

        Working...