Click here to Skip to main content
15,917,005 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Find Data Pin
Ravi Bhavnani14-Nov-03 3:02
professionalRavi Bhavnani14-Nov-03 3:02 
GeneralRe: Find Data Pin
Anonymous14-Nov-03 4:05
Anonymous14-Nov-03 4:05 
GeneralRe: Find Data Pin
Ravi Bhavnani14-Nov-03 5:01
professionalRavi Bhavnani14-Nov-03 5:01 
GeneralRe: Find Data Pin
Anonymous14-Nov-03 5:10
Anonymous14-Nov-03 5:10 
GeneralRe: Find Data Pin
Ravi Bhavnani14-Nov-03 6:02
professionalRavi Bhavnani14-Nov-03 6:02 
GeneralRe: Find Data Pin
Steve S14-Nov-03 5:30
Steve S14-Nov-03 5:30 
GeneralGDI+ DrawString() and printing Pin
Salvador Dali14-Nov-03 1:50
Salvador Dali14-Nov-03 1:50 
GeneralRe: GDI+ DrawString() and printing Pin
bouli14-Nov-03 3:41
bouli14-Nov-03 3:41 
maybe you developped in "small fonts" and you tested the application on a system that displays "large fonts". It's usual.

You may create a base dialog that resizes the resources according to a given font (small/large and points). in this base dialog, overload the DoModal function. add the following code:

INT_PTR CBaseDialog::DoModal()
{
CDialogTemplate dlgt;
INT_PTR nResult;

// load dialog template
if (!dlgt.Load(MAKEINTRESOURCE(m_nIDTemplate)))
return -1;

// set the system font
dlgt.SetFont(m_strFontFaceName, m_nPointSize);

// get pointer to the modified dialog template
LPSTR pdata=(LPSTR) GlobalLock(dlgt.m_hTemplate);

// let MFC know that you are using your own template
m_lpszTemplateName=NULL;
InitModalIndirect(pdata);

// display dialog box
nResult=__super::DoModal();

// unlock memory object
GlobalUnlock(dlgt.m_hTemplate);

return nResult;
}

Normaly, according to the size of font, no matter it is large or small, with this overload of DoModal, your dialog boxes will always look the same on any resolutions. the controls will even resize themselves according to the font. if the font system settings change while your application is still running, you may restart your app to apply the new settings.

Best regards.

Bouli.
GeneralRe: GDI+ DrawString() and printing Pin
Salvador Dali14-Nov-03 4:25
Salvador Dali14-Nov-03 4:25 
GeneralRe: GDI+ DrawString() and printing Pin
Anonymous14-Nov-03 10:07
Anonymous14-Nov-03 10:07 
GeneralRe: GDI+ DrawString() and printing Pin
Roger Allen14-Nov-03 4:22
Roger Allen14-Nov-03 4:22 
GeneralNeed step by step help for creating windows nt services Pin
Aswin14-Nov-03 1:22
Aswin14-Nov-03 1:22 
GeneralRe: Need step by step help for creating windows nt services Pin
Ravi Bhavnani14-Nov-03 3:08
professionalRavi Bhavnani14-Nov-03 3:08 
GeneralNeed step by step help for creating windows nt services Pin
Aswin14-Nov-03 1:21
Aswin14-Nov-03 1:21 
GeneralUsing VB dll in C++ Pin
Killen14-Nov-03 1:00
Killen14-Nov-03 1:00 
GeneralRe: Using VB dll in C++ Pin
Adam Gritt14-Nov-03 3:17
Adam Gritt14-Nov-03 3:17 
GeneralRe: Using VB dll in C++ Pin
Killen16-Nov-03 23:16
Killen16-Nov-03 23:16 
GeneralInserting Image Pin
rld7714-Nov-03 0:35
rld7714-Nov-03 0:35 
GeneralCComboBox populating doesn't work. Pin
Member 70440714-Nov-03 0:29
Member 70440714-Nov-03 0:29 
GeneralRe: CComboBox populating doesn't work. Pin
Rage14-Nov-03 2:12
professionalRage14-Nov-03 2:12 
GeneralRe: CComboBox populating doesn't work. Pin
Prakash Nadar14-Nov-03 2:49
Prakash Nadar14-Nov-03 2:49 
GeneralTo draw something over a Browser Hosted application Window Pin
csylesh14-Nov-03 0:24
csylesh14-Nov-03 0:24 
GeneralRe: To draw something over a Browser Hosted application Window Pin
Ceri14-Nov-03 0:53
Ceri14-Nov-03 0:53 
QuestionHow can I place an icon in an menu Pin
Anonymous14-Nov-03 0:13
Anonymous14-Nov-03 0:13 
AnswerRe: How can I place an icon in an menu Pin
Simon.W14-Nov-03 0:28
Simon.W14-Nov-03 0:28 

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.