lfFaceName compiler error
-
using ppc2k2 sdk and getting "cannot convert from 'unsigned short [7]' to 'unsigned short [32]" compiler error on the following snippet...sdk doc's say lfFaceName member should be a null terminated string specifying typeface name of desired font
LOGFONT* lplf; memset(lplf, 0, sizeof(LOGFONT)); lplf->lfFaceName = _T("Tahoma");
any ideas?.....thanks -
using ppc2k2 sdk and getting "cannot convert from 'unsigned short [7]' to 'unsigned short [32]" compiler error on the following snippet...sdk doc's say lfFaceName member should be a null terminated string specifying typeface name of desired font
LOGFONT* lplf; memset(lplf, 0, sizeof(LOGFONT)); lplf->lfFaceName = _T("Tahoma");
any ideas?.....thanksTry the following:
_tcscpy(lplf->lfFaceName, _T("Tahoma"));
Daniel ;) --------------------------- Never change a running system! -
Try the following:
_tcscpy(lplf->lfFaceName, _T("Tahoma"));
Daniel ;) --------------------------- Never change a running system! -
after making the change, i now get the following C2440 compiler error:
cannot convert from 'unsigned short *' to 'unsigned short [32]'
There are no conversions to array types, although there are conversions to references or pointers to arraysTake a look on João Paulo's "A font chooser dialog for the Pocket PC" article. He also uses the
LOGFONT
struct and it works:...
LOGFONT lf;
...
//
// Create the bold font
//
lf.lfHeight = -11;
lf.lfWidth = 0;
lf.lfEscapement = 0;
lf.lfOrientation = 0;
lf.lfWeight = FW_BOLD;
lf.lfItalic = FALSE;
lf.lfUnderline = FALSE;
lf.lfStrikeOut = 0;
lf.lfCharSet = ANSI_CHARSET;
lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
_tcscpy(lf.lfFaceName, TEXT("Tahoma"));
m_fontBold.CreateFontIndirect(&lf);
...Daniel ;) --------------------------- Never change a running system!
-
Take a look on João Paulo's "A font chooser dialog for the Pocket PC" article. He also uses the
LOGFONT
struct and it works:...
LOGFONT lf;
...
//
// Create the bold font
//
lf.lfHeight = -11;
lf.lfWidth = 0;
lf.lfEscapement = 0;
lf.lfOrientation = 0;
lf.lfWeight = FW_BOLD;
lf.lfItalic = FALSE;
lf.lfUnderline = FALSE;
lf.lfStrikeOut = 0;
lf.lfCharSet = ANSI_CHARSET;
lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
_tcscpy(lf.lfFaceName, TEXT("Tahoma"));
m_fontBold.CreateFontIndirect(&lf);
...Daniel ;) --------------------------- Never change a running system!