Hi all
I am facing a strange problem. I am using sprintf or swprintf according to the build defines with or without unicode. I have wrapped these functions in my own function like this:
int mysprintf( MCHAR* str,size_t size, const MCHAR* format, ... )
{
#ifdef MYUNICODE
return swprintf( str, size, format);
#else
return snprintf( str, format);
#endif
}
These function are in a String class which is a separate project and is compiled as a lib. I use it in another program. Now if I use the mysprintf()
msprintf(str,10, _M("%d,%d"),height,width);
I get some garbage values in the string buffer. But if I directly call the swprintf function from the program it works fines. I have defined UNICODE in the build and the function swprintf does get called, but it fills some garbage values. I dont understand what is going wrong.
Thanks Amit