Click here to Skip to main content
15,891,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Help to find an excesive memory allocation in my application Pin
jschell30-Aug-12 8:35
jschell30-Aug-12 8:35 
QuestionMFC how to popup menu when i right click leaf node which is under the root node Pin
Member 934498629-Aug-12 23:24
Member 934498629-Aug-12 23:24 
AnswerRe: MFC how to popup menu when i right click leaf node which is under the root node Pin
Richard MacCutchan29-Aug-12 23:29
mveRichard MacCutchan29-Aug-12 23:29 
GeneralRe: MFC how to popup menu when i right click leaf node which is under the root node Pin
Member 934498630-Aug-12 22:12
Member 934498630-Aug-12 22:12 
QuestionHow to avoid message Queue on click event? Pin
Le@rner29-Aug-12 19:34
Le@rner29-Aug-12 19:34 
AnswerRe: How to avoid message Queue on click event? Pin
Jochen Arndt30-Aug-12 0:53
professionalJochen Arndt30-Aug-12 0:53 
GeneralRe: How to avoid message Queue on click event? Pin
Le@rner31-Aug-12 20:35
Le@rner31-Aug-12 20:35 
QuestionEnumFontFamiliesEx only returns one font -- SOLVED Pin
Alan Balkany29-Aug-12 8:49
Alan Balkany29-Aug-12 8:49 
Hi all,

I'm trying to use EnumFontFamiliesEx to get all the fonts on a Windows 7 system, and it only returns one font: "System".

I tried to follow the incomplete documentation for this function here: http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k%28%22WINGDI%2fENUMFONTFAMILIESEX%22%29;k%28ENUMFONTFAMILIESEX%29;k%28DevLang-%22C%2B%2B%22%29;k%28TargetOS-WINDOWS%29&rd=true[^]

but with no luck. Here's my function (in a dialog-based MFC app):

C++
void CAllFontsDlg::fillListBoxWithFonts ()
{
	lb = (CListBox*) GetDlgItem (IDC_LIST1);
	CDC* pDC = GetDC ();
	LOGFONT lf;

		// To enumerate all styles and charsets of all fonts: 
	lf.lfFaceName[0] = '\0';
	lf.lfCharSet = DEFAULT_CHARSET;
	HRESULT hr;
	hr = EnumFontFamiliesEx (pDC->m_hDC, &lf, EnumFontFamExProc, 0, 0);
}


And here's my callback function (which is called exactly once):

C++
CListBox* lb;

int CALLBACK EnumFontFamExProc(
  const LOGFONT *lpelfe,
  const TEXTMETRIC *lpntme,
  DWORD FontType,
  LPARAM lParam)
{
	
	lb->AddString (lpelfe->lfFaceName);
	return 0;
}


Can anyone see what I'm doing wrong? Thanks!
"Microsoft -- Adding unnecessary complexity to your work since 1987!"

AnswerRe: EnumFontFamiliesEx only returns one font -- SOLVED Pin
Alan Balkany29-Aug-12 8:53
Alan Balkany29-Aug-12 8:53 
Questionfunny with boost::tribool Pin
Robin Imrie29-Aug-12 6:44
professionalRobin Imrie29-Aug-12 6:44 
AnswerRe: funny with boost::tribool (modified) Pin
Chris Meech29-Aug-12 7:14
Chris Meech29-Aug-12 7:14 
GeneralRe: funny with boost::tribool (modified) Pin
Robin Imrie30-Aug-12 2:31
professionalRobin Imrie30-Aug-12 2:31 
GeneralRe: funny with boost::tribool (modified) Pin
Chris Meech30-Aug-12 3:16
Chris Meech30-Aug-12 3:16 
GeneralRe: funny with boost::tribool Pin
CPallini29-Aug-12 11:09
mveCPallini29-Aug-12 11:09 
GeneralRe: funny with boost::tribool Pin
Robin Imrie30-Aug-12 23:28
professionalRobin Imrie30-Aug-12 23:28 
GeneralRe: funny with boost::tribool Pin
Chris Meech31-Aug-12 2:16
Chris Meech31-Aug-12 2:16 
Questionhow to share data between two dlls.? Pin
mbatra3128-Aug-12 1:08
mbatra3128-Aug-12 1:08 
AnswerRe: how to share data between two dlls.? Pin
Maximilien28-Aug-12 3:06
Maximilien28-Aug-12 3:06 
GeneralRe: how to share data between two dlls.? Pin
mbatra3128-Aug-12 19:30
mbatra3128-Aug-12 19:30 
QuestionIs it possible to use std::wstring parameter type in DLL? Pin
Falconapollo27-Aug-12 23:57
Falconapollo27-Aug-12 23:57 
AnswerRe: Is it possible to use std::wstring parameter type in DLL? Pin
CPallini28-Aug-12 0:29
mveCPallini28-Aug-12 0:29 
AnswerRe: Is it possible to use std::wstring parameter type in DLL? Pin
Richard MacCutchan28-Aug-12 7:41
mveRichard MacCutchan28-Aug-12 7:41 
QuestionIPreviewHandler generate BEX error Pin
Le@rner27-Aug-12 22:19
Le@rner27-Aug-12 22:19 
QuestionSending preformed UDP Packets to localhost with C++ Pin
Member 936259727-Aug-12 12:31
Member 936259727-Aug-12 12:31 
QuestionC++ : pass a string array to LPARAM Pin
Atlence27-Aug-12 6:57
Atlence27-Aug-12 6:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.