积极答复者
求教CScrollView问题

问题
-
我用VS2008的Feature Pack建立一个基于CView的SDI程序,后来想在原程序上把CView改为CScrollView从而实现滚动视图的功能,但是我改完后,在 debug模式下运行程序,会出现发送错误对话框(提示程序遇到问题需要关闭),点击对话框上的调试按钮,程序停留在dbgrptt.c文件以下代码处:
/* These methods don't need a separate
点击continue按钮,程序停留在viewscrl.cpp文件的以下代码处:
wchar version. Hence they need to be compiled only once from
the original file */
_CRTIMP void _cdecl _CrtDbgBreak(
void
)
{
DebugBreak();
} <--停留在此处/////////////////////////////////////////////////////////////////////////////
但是后来我把程序改成release模式时程序就能正常运行了,请教各位大侠这到底是为什么呀?有什么解决方法么?谢谢!!!
// CScrollView painting
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");
ASSERT(FALSE); <-- 停留在此处
return;
}
#endif //_DEBUG
答案
-
Error: must call SetScrollSizes() or SetScaleToFitSize()
这里不是说得很明白了么?
要设大小才知道滚动条是否该创建啊
Please mark the post answered your question as the answer, and click the chartreuse pyramid floating over nothingness/null to mark other helpful posts as helpful. This posting is provided "AS IS" with no warranties, and confers no rights.
Visual C++ MVP- 已标记为答案 Tim Li 2009年7月16日 9:40
全部回复
-
Error: must call SetScrollSizes() or SetScaleToFitSize()
这里不是说得很明白了么?
要设大小才知道滚动条是否该创建啊
Please mark the post answered your question as the answer, and click the chartreuse pyramid floating over nothingness/null to mark other helpful posts as helpful. This posting is provided "AS IS" with no warranties, and confers no rights.
Visual C++ MVP- 已标记为答案 Tim Li 2009年7月16日 9:40