Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC6 WinXP
I have used static text control with id :IDC_STATIC. Font size of static control is changed using below
 
CFont title4font, title5font;
VERIFY(title3font.CreateFont(18,0,0,0,FW_BOLD,FALSE,FALSE,0,
 
ANSI_CHARSET,OUT_DEFAULT_PRECIS,
		CLIP_DEFAULT_PRECIS,PROOF_QUALITY,DEFAULT_PITCH | FF_SWISS,"Arial"));
 
title5 = (CStatic*)GetDlgItem(IDC_STATIC);
title5->SetFont(&title3font,TRUE);
 
when i run this program in windows xp, it works fine and but when i run this program in windows 98, problem occurs showing this message
"Invalid Page Fault in MFC42D.dll".
 
In debug mode, i got message "Unhandled exception in XXXXX.exe (MFC42d.dll): 0xc0000005 Access Violation
But same program when i change ID of static text control to IDC_STATIC2, it works fine both in XP, 98.
Posted 10-Aug-12 1:17am
Edited 10-Aug-12 1:28am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

IDC_STATIC is a pre-defined symbol, used by many different controls. you can't change it's font.
 
you'll need to change the control's ID to a new value.
 
But same program when i change ID of static text control to IDC_STATIC2

yes, like that.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 265
1 CPallini 235
2 OriginalGriff 233
3 Maciej Los 175
4 George Jonsson 170
0 OriginalGriff 5,305
1 DamithSL 4,382
2 Maciej Los 3,760
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,901


Advertise | Privacy | Mobile
Web02 | 2.8.141216.1 | Last Updated 10 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100