Hi Tony,
+ WideCharToMultiByte(CP_ACP, 0, This->desc.FaceName, -1, desc->FaceName, sizeof(desc->FaceName) / sizeof(CHAR), NULL, NULL);
sizeof(desc->FaceName) / sizeof(CHAR) won't give you the length of the string (remember that sizeof is evaluated at compile time, so the value is a constant)
Regards, Roderick
Roderick Colenbrander schrieb:
Hi Tony,
- WideCharToMultiByte(CP_ACP, 0, This->desc.FaceName, -1,
desc->FaceName, sizeof(desc->FaceName) / sizeof(CHAR), NULL, NULL);
sizeof(desc->FaceName) / sizeof(CHAR) won't give you the length of the string (remember that sizeof is evaluated at compile time, so the value is a constant)
Regards, Roderick
FaceName is an array of (W)CHARs with a fixed size of LF_FACESIZE, so that would be okay, wouldn't it? The code which is in the official tree right now does this, too, so I thought it'd be okay.
Wasn't aware that it was a buffer with a fixed size. Then you are correct and it should work.
Roderick
On Wed, Jun 17, 2009 at 9:04 PM, Tony Wasserkatony.wasserka@freenet.de wrote:
Roderick Colenbrander schrieb:
Hi Tony,
- WideCharToMultiByte(CP_ACP, 0, This->desc.FaceName, -1,
desc->FaceName, sizeof(desc->FaceName) / sizeof(CHAR), NULL, NULL);
sizeof(desc->FaceName) / sizeof(CHAR) won't give you the length of the string (remember that sizeof is evaluated at compile time, so the value is a constant)
Regards, Roderick
FaceName is an array of (W)CHARs with a fixed size of LF_FACESIZE, so that would be okay, wouldn't it? The code which is in the official tree right now does this, too, so I thought it'd be okay.