Hi,
I'm working on a MUI program in C on OS4 and I have a little problem with the MUIA_Application_Version.
Before that I learned how to obtain a localized date, my MUIA_Application_Version string was simply a string.
But now I want to concatenate a localized date to this string and it doesn't work with the Version command.
What is strange is that it works fine when I look the version with Exchange commodity or with the class AboutBox.
More precisely, I have a string who contained "$VER: SysMon 2.1" and I want to concatenate a date, for example 01/10/2012.
With Exchange and AboutBox, I have the right string "SysMon 2.1 (01/10/2012)"
With Version, I obtain "SysMon 2.1 (%s)", if I use sprintf or snprintf, or "SysMon 2.1", if I use strcpy and strcat.
The results are the same if I replace the date string with a simple string.
Here is my code
char Chaine_Version_SysMon[128];
char Date_SysMon[16];
char dtdate[LEN_DATSTRING]; /* date from DateToStr...dat_StrDate */
...
strcpy(Date_SysMon,dtdate);
sprintf(Chaine_Version_SysMon,"$VER: SysMon 2.1 (%s)",Date_SysMon); /* I tried to directly with dtdate */
or
snprintf(Chaine_Version_SysMon,sizeof(Chaine_Version_SysMon),"$VER: SysMon 2.1 (%s)",Date_SysMon);
or
strcpy(Chaine_Version_SysMon,"$VER: SysMon 2.1");
strcat(Chaine_Version_SysMon," (");
strcat(Chaine_Version_SysMon,Date_SysMon);
strcat(Chaine_Version_SysMon,")");
...
MUIA_Application_Version,Chaine_Version_SysMon,
With sprintf :
Version String = SysMon 2.1 (%s)
AboutBox = SysMon 2.1 (01/10/2012)
Exchange = SysMon 2.1 (01/10/2012)
With strcpy, strcat :
Version String = SysMon 2.1
AboutBox = SysMon 2.1 (01/10/2012)
Exchange = SysMon 2.1 (01/10/2012)
Sorry for the long post, but if somebody could say me where I'm wrong, it will be very nice :)
Thanks you by advance,
zzd10h