all groups > dotnet xml > february 2004 >
You're in the

dotnet xml

group:

CultureInfo changed on Callback threads?


CultureInfo changed on Callback threads? chadb
2/27/2004 10:16:09 AM
dotnet xml:
Basic scenario
-Winforms client calling an asp.net web service on Windows X

Problem: When I perform an async web service call from a winform client, my Thread.CurrentCulture and Thread.CurrentUICulture are changed from the initiating thread's culture

Some code

Set all the Cultures to a different culture

static void Main()

Thread.CurrentThread.CurrentCulture = new CultureInfo("fi-FI")
Thread.CurrentThread.CurrentUICulture = new CultureInfo("fi-FI")
Application.CurrentCulture = new CultureInfo("fi-FI")
Application.Run(new SomeForm())


Make an Async webservice call

IAsyncResult ar = myWebService.BeginSomeWebServiceMethod(new AsyncCallback(MyCallback), "hi")

Recieve the callback

private void GetDatabaseInfoCallback(IAsyncResult ar)

string retval = myWebService.EndSomeWebServiceMethod(ar)
//Thread.CurrentThread.CurrentCulture.Name is now "en-US


Is this correct? How can I get my callback threads to be in the same culture as the Application thread

Thanks

Chad Brockma
chadbr@yahoo.co
RE: CultureInfo changed on Callback threads? chadb
3/11/2004 10:01:10 AM
AddThis Social Bookmark Button