cannot get text of __DATE__ (resolved)
-
Visual Studio 2008, C++, MFC
lang="cs">
const char build_date[] = __DATE__;
swprintf_s( my_date, my_size, L"%s", build_date );
swprintf_s( my_date, my_size, L"%ls, build_date );
show_date.SetWindowTextW( my_date );show_date.SetWindowText( __DATE__
show_date.SetWindowText( L"this displays" );String my_date does not contain the date that is found in build_date. Multiple versions have been tried and not successful in getting compile date to display in the dialog. All the searches I have done tell me this should work. What must be changed?
Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com
-
Visual Studio 2008, C++, MFC
lang="cs">
const char build_date[] = __DATE__;
swprintf_s( my_date, my_size, L"%s", build_date );
swprintf_s( my_date, my_size, L"%ls, build_date );
show_date.SetWindowTextW( my_date );show_date.SetWindowText( __DATE__
show_date.SetWindowText( L"this displays" );String my_date does not contain the date that is found in build_date. Multiple versions have been tried and not successful in getting compile date to display in the dialog. All the searches I have done tell me this should work. What must be changed?
Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com
-
You are using the wide character version of
swprintf_s
, but your date string ischar
type, so you need to use the upper case S in your format string so it gets converted to Unicode, thus:swprintf_s( my_date, my_size, L"%S", build_date );
That was it. Thank you.
Thank you for your time If you work with telemetry, please check this bulletin board: www.irigbb.com