使用静态文本控件的无效页面错误 [英] invalid page fault using static text control
本文介绍了使用静态文本控件的无效页面错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用了ID为:IDC_STATIC的静态文本控件.静态控件的字体大小使用以下
进行更改
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);
当我在Windows XP中运行此程序时,它工作正常,但是当我在Windows 98中运行此程序时,出现了显示此消息的问题
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
但是,当我将静态文本控件的ID更改为IDC_STATIC2时,该程序在XP 98中都可以正常工作.
But same program when i change ID of static text control to IDC_STATIC2, it works fine both in XP, 98.
推荐答案
IDC_STATIC是预定义的符号,由许多不同的控件.您不能更改其字体.
您需要将控件的ID更改为新值.
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.
但是当我将静态文本控件的ID更改为IDC_STATIC2时是同一程序
But same program when i change ID of static text control to IDC_STATIC2
是的,就是这样.
yes, like that.
这篇关于使用静态文本控件的无效页面错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文