Bon, j'ai l'air d'avoir un autre problème, chaque chose en son temps 
dans mon activeX, j'initialise donc une propriété stamp_font
1 2 3
| static const FONTDESC stamp_font_desc_ =
{ sizeof(FONTDESC), OLESTR("MS Sans Serif"), FONTSIZE(14), FW_BOLD,
ANSI_CHARSET, FALSE, FALSE, FALSE }; |
PX_Font(pPX, _T("StampFont"), *stamp_font_, & stamp_font_desc_);
je veux savoir si cette propriété est celle que j'ai mise par défaut (à savoir le Ms Sans Serif, en 14 gras)
donc, je me propose de tester la propriété (stamp_font) ; pour cela je la transforme en LOGFONT
1 2 3 4 5 6
|
CFont *pInternalFont=NULL;
pInternalFont = CFont::FromHandle(stamp_font_->GetFontHandle());
LOGFONT lf1,lf2;
pInternalFont ->GetLogFont(&lf1); |
et je la tete avec une LOGFONT crée à partir de la valeur par défaut
1 2 3 4 5
|
CFontHolder * priv_font = new CFontHolder(NULL);
priv_font->InitializeFont(&stamp_font_desc_);
pInternalFont = CFont::FromHandle(priv_font->GetFontHandle());
pInternalFont ->GetLogFont(&lf2); |
et à premiere vue, le debugger ne me donne pas les memes valeurs pour le lf1 et lf2 (nottament pour le .lfHeight) (avec ma méthode ou la tienne, c pareil)
Tu saurais où je me suis raté ?
Partager