473,500 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ISynchronizeInvoke and UI Culture problem

Hi NG !
I set the CurrentCulture and the CurrentUICulture at the start of my
app using this code:

string sUICulture =
System.Configuration.ConfigurationSettings.AppSett ings["UICulture"];
if (sUICulture != null) {
CultureInfo cultInfo = new CultureInfo(sUICulture);
Thread.CurrentThread.CurrentUICulture = cultInfo;
Thread.CurrentThread.CurrentCulture = cultInfo;
}

That fine, all my UI text appears according the settings in the
app.config. But in one case, I handle an event of a related system. (At
the moment no synchronisation is done). This code runs with the culture
settings of the System. (That's OK, because i did not synchronize). Now
I would like to check if Invoke is required (InvokeRequired). But this
does not work. The value is set to true, but if I debug the project,
the code within the if clause would not be executed. Why ?
In this state of execution it is possible to retrieve the
CurrentUICulture for the thread, but after an aditional call of a
function, it is neither possible the get the UICulture from the thread,
nor from the System. Why? What could go wrong ?

Thanks
Marcel

Sep 15 '06 #1
1 2385
I'm sorry my fault I just have the following problem:
I set the CurrentCulture and the CurrentUICulture at the start of my
app using this code:

string sUICulture =
System.Configuration.ConfigurationSettings.AppSett ings["UICulture"];
if (sUICulture != null) {
CultureInfo cultInfo = new CultureInfo(sUICulture);
Thread.CurrentThread.CurrentUICulture = cultInfo;
Thread.CurrentThread.CurrentCulture = cultInfo;
}

That fine, all my UI text appears according the settings in the
app.config. But in one case, I handle an event of a related system. (At
the moment no synchronisation is done). This code runs with the culture
settings of the System. (That's OK, because i did not synchronize).
In this state of execution it is possible to retrieve the
CurrentUICulture for the thread, but after an additional call of a
function, it is neither possible the get the UICulture from the thread,
nor from the System. Why? What could go wrong ?


schaf schrieb:
Hi NG !
I set the CurrentCulture and the CurrentUICulture at the start of my
app using this code:

string sUICulture =
System.Configuration.ConfigurationSettings.AppSett ings["UICulture"];
if (sUICulture != null) {
CultureInfo cultInfo = new CultureInfo(sUICulture);
Thread.CurrentThread.CurrentUICulture = cultInfo;
Thread.CurrentThread.CurrentCulture = cultInfo;
}

That fine, all my UI text appears according the settings in the
app.config. But in one case, I handle an event of a related system. (At
the moment no synchronisation is done). This code runs with the culture
settings of the System. (That's OK, because i did not synchronize). Now
I would like to check if Invoke is required (InvokeRequired). But this
does not work. The value is set to true, but if I debug the project,
the code within the if clause would not be executed. Why ?
In this state of execution it is possible to retrieve the
CurrentUICulture for the thread, but after an aditional call of a
function, it is neither possible the get the UICulture from the thread,
nor from the System. Why? What could go wrong ?

Thanks
Marcel
Sep 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2207
by: GM | last post by:
Hi, My application has a need to cache a number of shared reference lists containing basic business objects. In order to improve performance these lists are fetched and updated in the...
0
1396
by: Jedrzej Miadowicz | last post by:
I have a problem when using ISynchronizeInvoke.BeginInvoke with polymorphic parameters. It seems that if I try to call BeginInvoke and in the array of parameters place an object that's derived from...
2
1944
by: Tom Dacon | last post by:
I'm raising an event in a component, using ISynchronizeInvoke.Invoke, and my event args object contains a string as one of its members. If the string is longer than 63 bytes, the Invoke call pulls...
1
4987
by: Tim Murray | last post by:
Hi, I am creating a multithreaded server application in Managed C++. Each client that connects to the server will be running on their own thread to process their input. They all need to share...
0
2479
by: Wavemaker | last post by:
One of the things I've struggled with from time to time is handling events raised on different threads. For example, an object could be listening to events from one or more objects running in...
2
599
by: JezB | last post by:
How do I programatically set the culture at session level ?
1
3066
by: Thai Mai Shu | last post by:
What is wrong with my call below. If I change the delegate and the CallBackComplete function to not take in parameters then the .Invoke call works fine. As soon as I put the parameters back I...
4
4006
by: jherl | last post by:
I am getting an "Object reference not set to an instance of an object" when I try to execute the Invoke method. I have it set up as follows: --- Private _syncObject As...
6
6897
by: Mike9900 | last post by:
Hello, I want to view the calendar in another culture, for example let it show in Arabic. I use this code in the Main, but the calendar is still in the same culture: CultureInfo sa = new...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4923
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.