Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Regional Settings URGENT!!!!!

Status
Not open for further replies.

AndyGo

Programmer
Mar 30, 2002
3
IN
hi,
is it possible 2 change the date Format programmatically before starting my application if yes then how?

regards,
andy.
 
I would look into

MAKELANGID,MAKELCID, and SetThreadLocale

I am not sure if this alone will do it for you but there is a call GetThreadLocale which you could switch on.

Also, I recently wrote an MFC based global app that switches on thread locale to determine what dialog to display (i.e. Japanese, Spanish or English). This is where I read about thread locales.

Here is one option.

CString formatDate(int month, int day, int year)
{
UINT tLoc = GetThreadLocale();
CString ret;
switch(tLoc)
{
case ENGLISH_US:
ret.Format("%d/%d/%d",month,day,year);
break;
case JAPAN:
ret.Format("%d.%d.%d",year,month,day);
break;
}
return ret;
}


I dont know if the japan format is correct but it is just an example.

Matt


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top