I'm trying to change the font of the main dialog window (at run time) using the code below (found in the forum).
int CInitialDlg:oModal()
{
// TODO: Add your specialized code here and/or call the base class
CDialogTemplate dlt;
if (!dlt.Load(MAKEINTRESOURCE (CInitialDlg::IDD)))
return -1;
// set your own font, for example "Tahoma", 7 pts.
dlt.SetFont("Tahoma", 7);
// get pointer to the modified dialog template
LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate);
// let MFC know that you are using your own template
m_lpszTemplateName = NULL;
InitModalIndirect(pdata);
// display dialog box
nResult = CDialog:oModal();
// unlock memory object
GlobalUnlock(dlt.m_hTemplate);
return nResult;
}
It works fine but all the initial values of my combobox are lost. Is there anything to be done to load the values set on the VS Resource Editor instead of initialize them using ComboBox class members?
Thanks to all in advance.
Ricardo![]()


oModal()
Reply With Quote
