发信人: elife (穷·没饭吃·饿life), 信区: Npsos
标  题: [合集]帮我解一下这个问题?
发信站: 哈工大紫丁香 (2002年09月23日22:36:28 星期一), 站内信件


────────────────────────────────────────
 pray (望悠草)                        于 Sun Sep 22 16:00:28 2002) 说道:

我在运行程序时出现这样的问题,其中编译已经通过了!


Deg Assertion Failed!

File:viewscroll.cpp

Line:250

For information on how you program can cause a assertion failue!

See vc++ Documents on assets!

(press retry to debug the application)


────────────────────────────────────────
 allen (夏夜晚风·原来的我)           于 2002年09月22日16:03:11 星期天 说道:

 运行期异常啊 
 告诉你了可能在250行
【 在 pray (望悠草) 的大作中提到: 】
: 我在运行程序时出现这样的问题,其中编译已经通过了!


: Deg Assertion Failed!

: File:viewscroll.cpp

: Line:250

: For information on how you program can cause a assertion failue!


────────────────────────────────────────
 elife (穷,没饭吃,饿life)           于 2002年09月22日16:03:44 星期天 说道:

估计你的程序有没有申明的变量或者其他什么的
【 在 pray (望悠草) 的大作中提到: 】
: 我在运行程序时出现这样的问题,其中编译已经通过了!


: Deg Assertion Failed!

: File:viewscroll.cpp

: Line:250

: For information on how you program can cause a assertion failue!


────────────────────────────────────────
 pray (望悠草)                        于 Sun Sep 22 16:09:37 2002) 说道:


可我的的源程序好像没有250行呀!!


【 在 allen (夏夜晚风·原来的我) 的大作中提到: 】
:  运行期异常啊 
:  告诉你了可能在250行
: 【 在 pray (望悠草) 的大作中提到: 】
: : 我在运行程序时出现这样的问题,其中编译已经通过了!
: : 
: : 
: : Deg Assertion Failed!
: : 
: : File:viewscroll.cpp
: : 
: : Line:250
: : 
: : For information on how you program can cause a assertion failue!
: : 



────────────────────────────────────────
 elife (穷,没饭吃,饿life)           于 2002年09月22日16:10:16 星期天 说道:

把程序贴出来看看
【 在 pray (望悠草) 的大作中提到: 】

: 可我的的源程序好像没有250行呀!!


: 【 在 allen (夏夜晚风·原来的我) 的大作中提到: 】
: :  运行期异常啊 
: :  告诉你了可能在250行
: : 【 在 pray (望悠草) 的大作中提到: 】

────────────────────────────────────────
 pray (望悠草)                        于 Sun Sep 22 16:10:54 2002) 说道:


以下是源程序!

// keyscrollView.cpp : implementation of the CKeyscrollView class
//

#include "stdafx.h"
#include "keyscroll.h"

#include "keyscrollDoc.h"
#include "keyscrollView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CKeyscrollView

IMPLEMENT_DYNCREATE(CKeyscrollView, CScrollView)

BEGIN_MESSAGE_MAP(CKeyscrollView, CScrollView)
//{{AFX_MSG_MAP(CKeyscrollView)
ON_WM_KEYDOWN()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CKeyscrollView construction/destruction

CKeyscrollView::CKeyscrollView()
{
// TODO: add construction code here

}

CKeyscrollView::~CKeyscrollView()
{
}

BOOL CKeyscrollView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
//  the CREATESTRUCT cs

return CScrollView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CKeyscrollView drawing

void CKeyscrollView::OnDraw(CDC* pDC)
{
pDC->TextOut(100,100,"欢迎学习VC,这里是你的乐园");
// TODO: add draw code for native data here
}

void CKeyscrollView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();

CSize sizeTotal(250000,40000);
CSize sizePage(sizeTotal.cx/3,sizeTotal.cy/3);
CSize sizeLine(sizeTotal.cx/100,sizeTotal.cy/100);
SetScrollSizes(MM_TEXT,sizeTotal,sizePage,sizeLine);
}

/////////////////////////////////////////////////////////////////////////////
// CKeyscrollView printing

BOOL CKeyscrollView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}

void CKeyscrollView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}

void CKeyscrollView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CKeyscrollView diagnostics

#ifdef _DEBUG
void CKeyscrollView::AssertValid() const
{
CScrollView::AssertValid();
}

void CKeyscrollView::Dump(CDumpContext& dc) const
{
CScrollView::Dump(dc);
}

CKeyscrollDoc* CKeyscrollView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CKeyscrollDoc)));
return (CKeyscrollDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CKeyscrollView message handlers

void CKeyscrollView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
{

switch(nChar)
{case VK_HOME:
OnVScroll(SB_TOP,0,NULL);
OnHScroll(SB_LEFT,0,NULL);
break;
case VK_END:
OnVScroll(SB_BOTTOM,0,NULL);
OnHScroll(SB_RIGHT,0,NULL);
break;
default: break;

}
}




【 在 elife (穷,没饭吃,饿life) 的大作中提到: 】
: 估计你的程序有没有申明的变量或者其他什么的
: 【 在 pray (望悠草) 的大作中提到: 】
: : 我在运行程序时出现这样的问题,其中编译已经通过了!
: : 
: : 
: : Deg Assertion Failed!
: : 
: : File:viewscroll.cpp
: : 
: : Line:250
: : 
: : For information on how you program can cause a assertion failue!
: : 



────────────────────────────────────────
 allen (夏夜晚风·原来的我)           于 2002年09月22日16:40:57 星期天 说道:

 断言异常 别的不用看 专找ASSERT宏就行
 看看里面的语句是否有可能取到false值
【 在 pray (望悠草) 的大作中提到: 】

: 以下是源程序!

: // keyscrollView.cpp : implementation of the CKeyscrollView class
: //

: #include "stdafx.h"
: #include "keyscroll.h"

: #include "keyscrollDoc.h"
: #include "keyscrollView.h"

────────────────────────────────────────
 zgshit (浪漫已过)                    于 Sun Sep 22 20:48:44 2002) 说道:

其他同学的回答是对的。定义、说明出现了问题。

【 在 pray (望悠草) 的大作中提到: 】
: 我在运行程序时出现这样的问题,其中编译已经通过了!


: Deg Assertion Failed!

: File:viewscroll.cpp

: Line:250

: For information on how you program can cause a assertion failue!

: See vc++ Documents on assets!

: (press retry to debug the application)




────────────────────────────────────────
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.288毫秒