CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2007
    Location
    Argentina
    Posts
    579

    [RESOLVED] New thread change culture

    I had set, in program properties>application>assembly information, English-United States as neutral culture, and my program start with
    Code:
      My.Application.ChangeCulture("en-US")
    but each time I start a new thread, it automatically changes his culture to Spanish-Argentina, and Cdbl("0.2") converts to 20 instead of 0.2

    ¿is there a way to avoid it?
    [Vb.NET 2008 (ex Express)]

  2. #2
    Join Date
    Mar 2007
    Location
    Argentina
    Posts
    579

    Re: New thread change culture

    Quote Originally Posted by Marraco View Post
    I had set, in program properties>application>assembly information, English-United States as neutral culture, and my program start with
    Code:
      My.Application.ChangeCulture("en-US")
    but each time I start a new thread, it automatically changes his culture to Spanish-Argentina, and Cdbl("0.2") converts to 20 instead of 0.2

    ¿is there a way to avoid it?
    I had set this:
    Code:
            Dim ParalellProcess As New Thread(AddressOf LoopPrincipal)
            With ParalellProcess 
                .IsBackground = True
                .CurrentCulture = My.Application.Culture
                .Start()
    It looks like working, altought I don't know if is correct coding.
    [Vb.NET 2008 (ex Express)]

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: [RESOLVED] New thread change culture

    Here's a sample app.config setting...

    Code:
                <section name="SettingsAndResources.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=*****" allowExeDefinition="MachineToLocalUser" />
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Mar 2007
    Location
    Argentina
    Posts
    579

    Re: [RESOLVED] New thread change culture

    Quote Originally Posted by dglienna View Post
    Here's a sample app.config setting...

    Code:
                <section name="SettingsAndResources.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=*****" allowExeDefinition="MachineToLocalUser" />
    maybe app.config is a C# file. (I have not found that file).
    I found dozens designer-generated-code lines looking as your posted. Too many to risk broke something by hand editing. It should be a control in some place to change it.

    Do you think that new threads should not have the main application culture, or it is a bug?
    [Vb.NET 2008 (ex Express)]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured