Click to See Complete Forum and Search --> : How to use GetDateFormat()


mrRee
October 25th, 2004, 11:45 PM
I try to use GetDateFormat() as below:

TCHAR time[50];

GetDateFormat(LOCALE_SYSTEM_DEFAULT,0,NULL,"ddd':'MMM dd'th ,'yyyy",time,0);
SetDlgItemText(hWnd,IDC_DATE,time);

but the result display in the IDC_DATE(static text) are funny characters. I try to search how to use it but nothing help..

mrRee
October 26th, 2004, 12:11 AM
Argh.. silly me..

I should enter the size of the buffer(last parameter). If i left it to 0, the string buffer won't work.. and the function will only return the number of char to hold the string.

Sorry...........