Click here to Skip to main content
15,923,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: "Not Responding" - how to prevent? Pin
Joaquín M López Muñoz21-Jan-03 11:03
Joaquín M López Muñoz21-Jan-03 11:03 
GeneralRe: "Not Responding" - how to prevent? Pin
Christian Graus21-Jan-03 13:03
protectorChristian Graus21-Jan-03 13:03 
AnswerRe: "Not Responding" - how to prevent? Pin
Joaquín M López Muñoz21-Jan-03 9:49
Joaquín M López Muñoz21-Jan-03 9:49 
AnswerRe: "Not Responding" - how to prevent? Pin
#realJSOP21-Jan-03 10:21
professional#realJSOP21-Jan-03 10:21 
GeneralModeless dialog and OK button and renaming yet.... Pin
ns21-Jan-03 9:41
ns21-Jan-03 9:41 
GeneralRe: Modeless dialog and OK button and renaming yet.... Pin
Joaquín M López Muñoz21-Jan-03 9:44
Joaquín M López Muñoz21-Jan-03 9:44 
GeneralRe: Modeless dialog and OK button and renaming yet.... Pin
ns21-Jan-03 10:07
ns21-Jan-03 10:07 
GeneralHEEEEEEEEELLLLLLLPPPPP!!! Pin
mickelthepickle21-Jan-03 9:31
mickelthepickle21-Jan-03 9:31 
Hi,

I need some serious help setting a font in a CFormView (with an embedded CListCtrl)class. The on initial update code looks like this...

void CTextWindow::OnInitialUpdate()
{
CFormView::OnInitialUpdate();

//size the window to the proper side that would fit the parent
CFrameWnd *pParentFrame = GetParentFrame();
pParentFrame->RecalcLayout();
ResizeParentToFit(TRUE);

//displays the window text depending on the template used to
//create an instance of this class.
if(GetDocument()->GetDocTemplate() == theApp.pOutputDocTemplate)
pParentFrame->SetWindowText("Output Window");
else
pParentFrame->SetWindowText("");

//intialize the font to be used with a constant font
font.CreateFont(14,0,0,0,0,0,0,0,0,0,0,0, FIXED_PITCH | FF_MODERN, "Courier New");

//delete all entries from the list control
m_List.DeleteAllItems();
//set up list control to contain one column
m_List.InsertColumn(0,"Text",LVCFMT_LEFT, 1600, -1);
//set a font of the list control
m_List.SetFont(&font,FALSE);

//set a boolean flag to false to indicate that no file has been loaded yet.
fFileLoaded = false;
}

Pay attention to the lines....

//intialize the font to be used with a constant font
font.CreateFont(14,0,0,0,0,0,0,0,0,0,0,0, FIXED_PITCH | FF_MODERN, "Courier New");

m_List.SetFont(&font,FALSE);

I'm trying to implement font control in this program after the initial update, but I also want to set the font before this window is created. So I'm having a lot of trouble.

I try to make a member function that looks like this.

void CTextWindow::SetScreenFont (...)
{
//same font object as before
font.CreateFont (//parameters);
m_List.SetFont (&font, FALSE);
}

I do this and I get Debug Assertion errors in the Debug configuration and crashes in the Release! Can anyone tell me how to remedy this problem and get a working font control algorithm?

Thanks,
Mike Mathers
Generalresizing a dlg in splitter Pin
will138321-Jan-03 9:23
will138321-Jan-03 9:23 
GeneralRe: resizing a dlg in splitter Pin
Joaquín M López Muñoz21-Jan-03 9:30
Joaquín M López Muñoz21-Jan-03 9:30 
GeneralRe: resizing a dlg in splitter Pin
will138321-Jan-03 9:47
will138321-Jan-03 9:47 
GeneralREplacing a dialog resource Pin
ns21-Jan-03 8:29
ns21-Jan-03 8:29 
GeneralRe: REplacing a dialog resource Pin
AlexO21-Jan-03 8:42
AlexO21-Jan-03 8:42 
GeneralRe: REplacing a dialog resource(modified) Pin
ns21-Jan-03 9:08
ns21-Jan-03 9:08 
GeneralRe: REplacing a dialog resource Pin
Joaquín M López Muñoz21-Jan-03 8:52
Joaquín M López Muñoz21-Jan-03 8:52 
GeneralRe: REplacing a dialog resource Pin
ns21-Jan-03 9:06
ns21-Jan-03 9:06 
GeneralRe: REplacing a dialog resource Pin
Joaquín M López Muñoz21-Jan-03 9:11
Joaquín M López Muñoz21-Jan-03 9:11 
GeneralRe: REplacing a dialog resource Pin
ns21-Jan-03 9:29
ns21-Jan-03 9:29 
Generalturning off LVIS_SELECTED flags.. Pin
IrishSonic21-Jan-03 8:15
IrishSonic21-Jan-03 8:15 
GeneralRe: turning off LVIS_SELECTED flags.. Pin
Joaquín M López Muñoz21-Jan-03 9:26
Joaquín M López Muñoz21-Jan-03 9:26 
GeneralNeed VC++ tools for visual designer app Pin
dotmarker21-Jan-03 7:38
dotmarker21-Jan-03 7:38 
Questionwtf is "Hardcoded"? Pin
Hoornet9321-Jan-03 6:02
Hoornet9321-Jan-03 6:02 
AnswerRe: wtf is "Hardcoded"? Pin
benjymous21-Jan-03 6:11
benjymous21-Jan-03 6:11 
AnswerRe: wtf is "Hardcoded"? Pin
Tim Smith21-Jan-03 6:12
Tim Smith21-Jan-03 6:12 
AnswerRe: wtf is "Hardcoded"? Pin
AlexO21-Jan-03 6:25
AlexO21-Jan-03 6:25 

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.