标题:vc编程的一个问题,希望大家能尽量解决
只看楼主
zqlong
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-6-11
 问题点数:0 回复次数:0 
vc编程的一个问题,希望大家能尽量解决
我在xp下用妈VC6做了一个数据库小程序
其中有一段用dataGrid和datacontrol控件程序如下:
void CADO1View::OnSize(UINT nType, int cx, int cy)
{
int iHeight,iWidth;
CRect rect;

COleDBRecordView::OnSize(nType, cx, cy);

// TODO: Add your message handler code here
m_adoDC1.GetClientRect(rect);
iHeight=rect.Height();
iWidth=rect.Width();
m_adoDC1.MoveWindow(cx,cy,iWidth,iHeight,TRUE);
m_dataGrid1.MoveWindow(0,0,cx,cy-iHeight,TRUE);
}
编译调试后出现错误提示如下对话框:
Debug Assertion Failed!
File:afxWin2.inl
Line:98
For information on how your program can cause an assertion
failure,see the Visual C++ documentation on asserts.
经过初步测试是在执行“m_adoDC1.GetClientRect(rect)”,“m_adoDC1.MoveWindow(cx,cy,iWidth,iHeight,TRUE)”或是“m_dataGrid1.MoveWindow(0,0,cx,cy-iHeight,TRUE)”时会出现这样的错误,想问一直这是什么原因。
2007-06-11 21:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-146653-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.082902 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved