本文介绍了EnumFontFamiliesProc遇到了麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我有麻烦,请帮帮我!
我是MFC编程的初学者.我已经使用字体系统对程序进行了编码.通过一本书,我知道了使用两个功能列出字体系统的方法:

Hi every body!
I have a trouble, help me please!
I am a beginner in MFC programming. I have coded a progam using font system. Through a book, I knew the way to lists font system by using two functions:

int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD nFontType, LPARAM lParam)
{
    CFontDlg *pWnd = (CFontDlg*) lParam;
    //CFontDlg is the class base on the interface-dialog of my program
    pWnd->m_lbFont.AddString(lpelfe->elfLogFont.lfFaceName);
    //m_lbFont is a variable to control ListBox, which on I want to lists font system
    return 1;
}

void CFontDlg::FillFontList(void)
{
    LOGFONT lf;
    lf.lfCharSet = DEFAULT_CHARSET;
    lstrcpy(lf.lfFaceName, _T(""));
    m_lbFont.ResetContent();
    CClientDC dc(this);
    ::EnumFontFamiliesEx((HDC) dc, &lf, (FONTENUMPROC) EnumFontFamExProc, (LPARAM) this, 0);
}



当我生成程序时,出现错误:
错误C2440:类型转换":无法从重载函数"转换为"FONTENUMPROC"
我不明白发生了什么.请帮帮我!
我的地址:maidinhduong_2179 [at] yahoo.com.vn



When I build the program, there is a error:
error C2440: ''type cast'' : cannot convert from ''overloaded-function'' to ''FONTENUMPROC''
I can''t understand what is happended. Please help me!
My address: maidinhduong_2179 [at] yahoo.com.vn
Thankyou!

推荐答案



这篇关于EnumFontFamiliesProc遇到了麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 20:24