Error: must call SetScrollSizes() or SetScaleToFitSize()问题的解决
来源:互联网 发布:湖北广电网络官网 编辑:程序博客网 时间:2024/05/20 20:48
我的程序原来是基于CView的,但后来为了支持滚动功能所以按照网上的方法,手动把CView改为CScrollView(一些相应的处理都改了),但是程序运行后发生错误,调试发现程序进入下面的错误处理中。
void CScrollView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
ASSERT_VALID(pDC);
#ifdef _DEBUG
if (m_nMapMode == MM_NONE)
{
TRACE(traceAppMsg, 0, "Error: must call SetScrollSizes() or SetScaleToFitSize()");
TRACE(traceAppMsg, 0, "\tbefore painting scroll view.\n");
--->
return;
}
#endif //_DEBUG
......
}
问题原因;
造成这个问题的原因是:
窗口一开始就最大化造成的。
解决方案1:
1)在CXXXView的构造函数中加入以下语句:
CScanView::CScanView()
{
}
解决方案2:
2)重载OnPrepareDC函数:
void CScanView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
- Error: must call SetScrollSizes() or SetScaleToFitSize()问题的解决
- Error: must call SetScrollSizes() or SetScaleToFitSize()问题的解决
- 出现Error: must call SetScrollSizes() or SetScaleToFitSize()
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- 解决viewpaper与frament时出现的The specified child already has a parent. You must call removeView()问题
- android viewp嵌套Fragment时遇到The specified child already has a parent. You must call removeView()问题的解决
- 针对Error: You must either define the environment variable DJANGO_SETTINGS_MODULE ...问题的解决
- 解决卸载 Git 时候提示 “Runtime Error (at 18:1292): Could not call proc” 的问题
- PHP Fatal error: Call to a member function fetch_all() on a non-object问题的解决
- org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the query 问题的解决
- org.hibernate.QueryException: addEntity() or addScalar() must be called on a sql query before executing the qury 问题的解决
- Meteor Error: Must pass options.rootUrl or set ROOT_URL in the server environment解决
- 解决PHP问题:Fatal error: Call to undefined function: mysql_connect()
- 解决PHP问题:Fatal error: Call to undefined function: mysql_connect()
- 解决继承RecyclerView.Adapter界面崩溃及部分布局不显现的问题【 You must call removeView() on the child's parent first.】
- 1225 余数之和
- LlintCode:完美平方
- Linux 安装 .NET Core 1.0 SDK
- 博弈sg函数模板
- Codeforces Round #382 (Div. 1) A. Tennis Championship
- Error: must call SetScrollSizes() or SetScaleToFitSize()问题的解决
- Java获取函数参数名称的几种方法
- 15Spring整合HIbernate&Ibatis(不完整版)
- codeforces 739B B. Alyona and a tree
- AE基础动画参数之制作跳动音符
- Fragment 懒加载
- 线程练习2
- linux中 sed 替换
- Dialog所遇到的坑