Click here to Skip to main content
16,004,778 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CDatabase::ExecuteSQL Pin
Fawaz Ajani20-Mar-14 5:49
Fawaz Ajani20-Mar-14 5:49 
GeneralRe: CDatabase::ExecuteSQL Pin
David Crow20-Mar-14 3:17
David Crow20-Mar-14 3:17 
GeneralRe: CDatabase::ExecuteSQL Pin
Fawaz Ajani20-Mar-14 5:52
Fawaz Ajani20-Mar-14 5:52 
QuestionRe: CDatabase::ExecuteSQL Pin
Fawaz Ajani25-Mar-14 10:05
Fawaz Ajani25-Mar-14 10:05 
Questionshowwindow(SW_HIDE) question Pin
econy19-Mar-14 15:19
econy19-Mar-14 15:19 
AnswerRe: showwindow(SW_HIDE) question Pin
David Crow19-Mar-14 16:48
David Crow19-Mar-14 16:48 
AnswerRe: showwindow(SW_HIDE) question Pin
Albert Holguin20-Mar-14 14:44
professionalAlbert Holguin20-Mar-14 14:44 
QuestionHow to change CEdit font [Solved] Pin
econy19-Mar-14 10:16
econy19-Mar-14 10:16 
Hi, I want to change several CEdit's font in a dialog based program. the dialog is a non-modal dialog,in it's OnInitDialog().

C++
BOOL CTestFontDlg::OnInitDialog()
{
	CFont * pFontNew;
	LOGFONT lf;			//Use to create new font
	CEdit *pEdit1;
	CEdit *pEdit2;
	CEdit *pEdit3;
	
	CDialog::OnInitDialog();
	pApp = (CTestFont*) AfxGetApp();

	AddFontResource(TEXT("\\FlashDisk\\Startup\\Simsun.ttc"));	//Add font resource

	if ( pApp->g_Settings.language == LNG_CHINESE ) {
		lf.lfHeight = 12;
		lf.lfWidth  = 0;
		memset(&lf, 0, sizeof(LOGFONT));	// Clear lf structure,use it to create the font.
		WCHAR lffn[] = TEXT("Simsun(OpenType)"); 
		wcscpy(lf.lfFaceName,lffn);
		lf.lfCharSet = GB2312_CHARSET;
		pFontNew->CreateFontIndirect(&lf);
		//FontNew = CreateFontIndirect(&lf);
		
		pEdit1 = (CEdit *) GetDlgItem( IDC_INFO_PL );
		pEdit2 = (CEdit *) GetDlgItem( IDC_INFO_PRESS );
		pEdit3 = (CEdit *) GetDlgItem( IDC_INFO_TOP );
		pEdit1->SetFont(pFontNew);
		pEdit2->SetFont(pFontNew);
		pEdit3->SetFont(pFontNew);
	}

	return TRUE; 
}


but once I added the if ( pApp->g_Settings.language == LNG_CHINESE ) { ... } block,
the screen become black, nothing be displayed.

modified 19-Mar-14 18:54pm.

AnswerRe: How to change CEdit font Pin
econy19-Mar-14 12:53
econy19-Mar-14 12:53 
QuestionCapture Remote Camera using Media Foundation Pin
Django_Untaken19-Mar-14 0:27
Django_Untaken19-Mar-14 0:27 
QuestionDevice Build Pin
Member 1068204219-Mar-14 0:19
Member 1068204219-Mar-14 0:19 
GeneralRe: Device Build Pin
David Crow19-Mar-14 3:37
David Crow19-Mar-14 3:37 
AnswerRe: Device Build Pin
enhzflep25-Mar-14 22:36
enhzflep25-Mar-14 22:36 
Questionwhat is the behavior of a statement logically operated with 0? Pin
shaktikanta18-Mar-14 22:32
shaktikanta18-Mar-14 22:32 
AnswerRe: what is the behavior of a statement logically operated with 0? [fixed the blunder] Pin
CPallini19-Mar-14 0:40
mveCPallini19-Mar-14 0:40 
GeneralRe: what is the behavior of a statement logically operated with 0? Pin
shaktikanta19-Mar-14 21:58
shaktikanta19-Mar-14 21:58 
GeneralRe: what is the behavior of a statement logically operated with 0? Pin
CPallini19-Mar-14 22:15
mveCPallini19-Mar-14 22:15 
GeneralRe: what is the behavior of a statement logically operated with 0? Pin
shaktikanta20-Mar-14 19:12
shaktikanta20-Mar-14 19:12 
GeneralRe: what is the behavior of a statement logically operated with 0? Pin
CPallini21-Mar-14 2:10
mveCPallini21-Mar-14 2:10 
QuestionUsing .Net DLL in VC6 Pin
ZawMinTun18-Mar-14 18:15
ZawMinTun18-Mar-14 18:15 
AnswerRe: Using .Net DLL in VC6 Pin
David Knechtges19-Mar-14 8:05
David Knechtges19-Mar-14 8:05 
GeneralRe: Using .Net DLL in VC6 Pin
ZawMinTun21-Mar-14 0:08
ZawMinTun21-Mar-14 0:08 
Questionuse c++ to drive cmd window and get responses Pin
bkelly1318-Mar-14 15:57
bkelly1318-Mar-14 15:57 
AnswerRe: use c++ to drive cmd window and get responses Pin
Richard MacCutchan18-Mar-14 22:26
mveRichard MacCutchan18-Mar-14 22:26 
AnswerRe: use c++ to drive cmd window and get responses Pin
David Crow19-Mar-14 3:38
David Crow19-Mar-14 3:38 

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.