Click here to Skip to main content
16,006,845 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to place files in win32 console application project? Pin
padgyx16-Feb-02 13:01
padgyx16-Feb-02 13:01 
AnswerRe: how to place files in win32 console application project? Pin
alex.barylski16-Feb-02 13:36
alex.barylski16-Feb-02 13:36 
QuestionDoubleClick in CComboBox with dropdown-style? Pin
Rybeck16-Feb-02 11:29
Rybeck16-Feb-02 11:29 
AnswerRe: DoubleClick in CComboBox with dropdown-style? Pin
Rybeck17-Feb-02 5:10
Rybeck17-Feb-02 5:10 
GeneralMFC control that works like VB's Image Control Pin
16-Feb-02 10:20
suss16-Feb-02 10:20 
GeneralRe: MFC control that works like VB's Image Control Pin
alex.barylski16-Feb-02 11:30
alex.barylski16-Feb-02 11:30 
GeneralRe: MFC control that works like VB's Image Control Pin
Shog916-Feb-02 14:22
sitebuilderShog916-Feb-02 14:22 
GeneralCFontDialog Pin
16-Feb-02 8:24
suss16-Feb-02 8:24 
Hi,

I wanna change the current font in a EditView with CFont Dialog.

I have placed the following lines in my code:

  void CMainFrame::OnFont() 
{
       CMyDoc* pDoc = (CMyDoc*)GetActiveDocument();
	LOGFONT logfont;
	CFontDialog fontdlg;

	if (fontdlg.DoModal() == IDOK)
	{
		pDoc->m_Font.DeleteObject();
		pDoc->m_Font.CreateFontIndirect(&logfont);
	
		POSITION pos;
		pos = pDoc->GetFirstViewPosition();
		CMyEditView* pMyEditView;

		while (pos)
		{
			pMyEditView = (CMyEditView*)pDoc->GetNextView(pos);
			if (pMyEditView->IsKindOf(RUNTIME_CLASS(CMyEditView)))
				pMyEditView->Invalidate();
		}
	}
}


and

void CMyEditView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();	
	CEdit* pEdit = &GetEditCtrl();
	pEdit->SetFont(&pDoc->m_Font);
	pEdit->SetWindowText("My Text");
}


It does not work and dunno why.
Thanks for your help.

R.
GeneralRe: CFontDialog Pin
Joaquín M López Muñoz16-Feb-02 8:39
Joaquín M López Muñoz16-Feb-02 8:39 
GeneralRe: CFontDialog Pin
16-Feb-02 9:10
suss16-Feb-02 9:10 
GeneralRe: CFontDialog Pin
Joaquín M López Muñoz16-Feb-02 9:28
Joaquín M López Muñoz16-Feb-02 9:28 
GeneralSuccess Report Pin
16-Feb-02 9:48
suss16-Feb-02 9:48 
Generalcreating splitter wnd - per buttonclick Pin
16-Feb-02 8:23
suss16-Feb-02 8:23 
GeneralRe: creating splitter wnd - per buttonclick Pin
alex.barylski16-Feb-02 11:32
alex.barylski16-Feb-02 11:32 
GeneralProgram entry point - again Pin
Don Miguel16-Feb-02 8:03
Don Miguel16-Feb-02 8:03 
GeneralRe: Program entry point - again Pin
Joaquín M López Muñoz16-Feb-02 8:27
Joaquín M López Muñoz16-Feb-02 8:27 
GeneralRe: Program entry point - again Pin
Don Miguel16-Feb-02 21:30
Don Miguel16-Feb-02 21:30 
GeneralRe: Program entry point - again Pin
Michael Dunn16-Feb-02 9:22
sitebuilderMichael Dunn16-Feb-02 9:22 
GeneralRe: Program entry point - again Pin
Don Miguel16-Feb-02 21:27
Don Miguel16-Feb-02 21:27 
GeneralRe: Program entry point - again Pin
Paul M Watt16-Feb-02 21:37
mentorPaul M Watt16-Feb-02 21:37 
GeneralRe: Program entry point - again Pin
Don Miguel16-Feb-02 21:42
Don Miguel16-Feb-02 21:42 
GeneralRe: Program entry point - again Pin
Paul M Watt16-Feb-02 22:30
mentorPaul M Watt16-Feb-02 22:30 
GeneralRe: Program entry point - again Pin
Don Miguel16-Feb-02 22:47
Don Miguel16-Feb-02 22:47 
GeneralRe: Program entry point - again Pin
Rick York16-Feb-02 23:06
mveRick York16-Feb-02 23:06 
GeneralRe: Program entry point - again Pin
Don Miguel16-Feb-02 23:13
Don Miguel16-Feb-02 23:13 

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.