Error: must call SetScrollSizes() or SetScaleToFitSize()问题的解决
来源:互联网 发布:js实现bind 编辑:程序博客网 时间:2024/06/05 03:18
我的程序原来是基于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)
转载网址:
http://blog.sina.com.cn/s/blog_63a881060102vzas.html
http://bbs.csdn.net/topics/320022090
- 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.】
- Swift 框架搭建篇
- 基于spark的实时流数据需跟历史数据进行对比时所遇到的问题
- HTTP 错误 500.19- Internal Server Error 错误解决方法
- pixhawk学习笔记
- Simple Java—Strings and Arrays(三)为什么String被设计成了不可变型
- Error: must call SetScrollSizes() or SetScaleToFitSize()问题的解决
- iOS-如何在工程内添加pch预编译头文件
- 知识库
- hdoj 5052 Yaoge’s maximum profit 【树链剖分】
- Android 学习笔记(一)(客户端、服务器socket通信教程)
- Uva 1395
- MySQL Proxy
- pixhawk-----mavlink
- 捕获键盘中断