Debug Assertion Failed,FILE:afxwin1.inl LINE:22是怎么回事? [问题点数:30分,结帖人jeffery223]

Bbs1
本版专家分:39
结帖率 88.89%
Bbs9
本版专家分:59489
Blank
黄花 2011年10月 VC/MFC大版内专家分月排行榜第二
2009年11月 VC/MFC大版内专家分月排行榜第二
Blank
蓝花 2011年9月 VC/MFC大版内专家分月排行榜第三
Bbs11
本版专家分:255346
Blank
状元 2008年 总版技术专家分年内排行榜第一
Blank
进士 2009年 总版技术专家分年内排行榜第四
Blank
金牌 2009年2月 总版技术专家分月排行榜第一
2009年1月 总版技术专家分月排行榜第一
2008年11月 总版技术专家分月排行榜第一
2008年10月 总版技术专家分月排行榜第一
2008年9月 总版技术专家分月排行榜第一
2008年8月 总版技术专家分月排行榜第一
2008年7月 总版技术专家分月排行榜第一
2008年6月 总版技术专家分月排行榜第一
2008年5月 总版技术专家分月排行榜第一
2008年4月 总版技术专家分月排行榜第一
Blank
银牌 2008年12月 总版技术专家分月排行榜第二
2008年3月 总版技术专家分月排行榜第二
2008年2月 总版技术专家分月排行榜第二
Bbs9
本版专家分:54950
Debug Mode(afxwin1.inl line 22)
调试程序,编译没问题,一运行就显示 Error Debug Assertion <em>failed</em> rn<em>afxwin1.inl</em> <em>line</em> <em>22</em>rnrn按 Retry 显示mfc42ud.dll Offset 0007b2f3rnrn我重建了一个Dialog base Project 试了下都没问题,rn// The one and only CCXXXApp objectrnCCXXXApp theApp;rnrn运行后就出错,rnrn
Debug Assertion Failed file: ppgcolor.cpp .line:134
运行时显示如上.rn选"重试"后选"调试"rnrnvoid CColorButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)rnrn CDC *pDC;rn CPalette *pPal;rn CRect rcButton;rn CBrush *pBrush;rnrn // Get the palette for the item display contextrn pPal = CPalette::FromHandle(hPal); rn VERIFY(pPal);//标记此处出错.rnrn // Get the device context from the contextrn pDC = CDC::FromHandle(lpDrawItemStruct->hDC);rn VERIFY(pDC);rnrn VERIFY(pDC->SelectPalette(pPal,0));rn pDC->RealizePalette();
Debug Assertion Failed 是怎么回事
我在一个对话框中添加了一个tree控件,编译链接通过了,但在程序执行时弹出警告框,说Debug Assertion Failed ,这是什么原因,请大虾指教。谢谢
怎么回事啊?">debug assertion failed, file:dlgdata.cpp,line"44 这是怎么回事啊?
我的代码以前是可以运行的,而我在界面上添加了一个下拉框之后,就开始报这样的错,请问是<em>怎么回事</em>啊?
Debug assert failed, afxwin1.inl ,line 27
我做一个基于对话框的程序,但是一旦每次在App里面加一个virtual方法之后运行都会抛出这么个断言异常,把加进去的所有代码都删除了都还会这样,查源代码是rnrn_AFXWIN_INLINE LPCTSTR AFXAPI AfxGetAppName()rn ASSERT(afxCurrentAppName != NULL); return afxCurrentAppName; rnrnrn但是afxCurrentAppName这个东西从来没有在用户的代码里出现过rnrnrn我把VC6.0重装了还是会这样?请教哪位大哥帮帮忙
debug assertion failed! file:fseek.c
FILE * pFile;rn pFile=fopen("cityPath.data","wt+");rn if(dlg<em>file</em>.DoModal()==IDOK)rn rn strExe=dlg<em>file</em>.GetPathName();rn m_<em>file</em>othername=dlg<em>file</em>.GetFileTitle();rn fwrite(strExe,1,strlen(strExe),pFile);rn rn //menu.GetSubMenu(0)->EnableMenuItem(2,MF_BYPOSITION|MF_GRAYED|MF_DISABLED );rn rn rn elsern return;rn fclose(pFile);rnrnrnrn/////////////////////////////////rnrn CDialog::OnInitDialog();rn COleVariant var;rn CString m_<em>file</em>othername;rn CsoDataSource Datasource;rn rn FILE* pPath;rn rn pPath=fopen("cityPath.data","rt");rn CString strExe;rn char* pBuf;rn fseek(pPath,0,SEEK_END);//运行到这里就出错了rn int len=ftell(pPath);rn pBuf=new char[len+1];rn memset(pBuf,0,len+1);rn rewind(pPath);rn fread(pBuf,1,len,pPath);rn strExe.Format("%s",pBuf);rn fclose(pPath);rncityPath.data 我已经把它放在了当前工程里了,出现的是 rn<em>debug</em> <em>assertion</em> <em>failed</em>! rn program:... rn <em>file</em>:fseek.c rn <em>line</em>:101 rn expression:stream!=null
新手请教 debug asserton failed file: afxwin1.inl line: 800
<em>debug</em> asserton <em>failed</em> <em>file</em>: <em>afxwin1.inl</em> <em>line</em>: 800 rn是<em>怎么回事</em>rnrn程序中有ls=dc->GetTextExtent(lab,strlen(lab));一句rn在此处断开rnrn不知问题何在??
vc2008中debug assertion failed怎么回事
在vc2008中写一个测试dll的程序,弹出<em>debug</em> <em>assertion</em> <em>failed</em>的提醒,rn程序就几句话如下:rnrnvoid CdlltestDlg::OnBnClickedOk()rnrn // TODO: 在此添加控件通知处理程序代码rn int a = sum(3,4);rn rn AfxMessageBox(a);rn Message();rnrn OnOK();rnrn想请教各位是<em>怎么回事</em>?应该怎么修改了?
Debug Assertion Failed! 错误是怎么回事
Program:......(.exe)rnFile:viewform.cpprnLine:69rnrnFor information on how your program can cause an <em>assertion</em> failure,see the Visual C++ documentation on asserts.rnrn(Press Retry to <em>debug</em> the application)rnrnrn终止 重试 忽略rnrnrnrn出现这样的错误应该怎样解决?我是想在主框架中添加菜单的单击事件,在主框架中选择菜单后单击出现该菜单功能模块的子窗体,每次一点击时就出现这样的错误。在些求救一下,这到底是<em>怎么回事</em>?没感觉哪里有错误,以前做这类的东西没有这样的错误?
请问出现Debug Assertion Failed是怎么回事
我的程序编译通过rn但是运行的时候出现了Debug Assertion Failedrn请问大家这是<em>怎么回事</em>?谢谢!
CRecordset对象执行MoveFirst时候报错:Assertion Failed!File:afxwin1.inl line:22
做了一个ODBC操作ACCESS注册表的程序,编译链接都没错误,而且程序之前的读取是没有问题的,但是在执行MoveFirst函数时候报错:Assertion Failed!File:<em>afxwin1.inl</em> <em>line</em>:<em>22</em>.忽略后还会出现错误:Debug Assertion Failed! File:dbcore.cpp Line:66 求教各路大神~!!1rnrnrnBOOL ODBCConnect(CString &strDBFile)rnrn CString strConnect;rn strConnect.Format(_T("ODBC;DRIVER=MICROSOFT ACCESS DRIVER (*.mdb);UID=admin;PWD=admin;DBQ=%s"), strDBFile);rnrn CDatabase db;rn if(db.Open(NULL, FALSE, FALSE, strConnect))rn rn int iCounter = 0;rn //连接数据库成功rn cout << "数据库已经连接陈功!" << endl;rn CRecordset rs(&db);rn CString strSql;rn strSql = _T("select * from t_student"); //SQL语句rn rs.Open(CRecordset::forwardOnly,strSql); //执行Sql语句(可添加 删除 查询等)rn if(rs.IsOpen())rn rn cout << "记录集已开启" << endl;rn // CDBVariant variant;rn CString variant;rn // rs.MoveFirst();rn cout << "已移动到首位!" << endl;rn while(!rs.IsEOF())rn rn //读取记录rn cout << "开始读取" << endl;rn rs.GetFieldValue((short)0, variant);rn cout << variant;rn rs.GetFieldValue((short)1,variant);rn cout << "\t" << variant;rn rs.MoveNext();rn rn rn if (rs.IsEOF())rn rn rs.MoveFirst();rn rn rnrn rs.Close();rn db.Close();rn return TRUE;rn rn rn return FALSE;rn
错误 Debug Assertion Failed! file winbtn.cpp line 116
在一线程里 SetDlgItemText(id,L""); 弹出如标题 的错误
DAO错误,Debug Assertion Failed! File: daocore.cpp Line: 42
Debug Assertion Failed!rnFile: daocore.cpprnLine: 42rnrn点击忽略按钮,又出现rnrnDebug Assertion Failed!rnFile: daocore.cpprnLine: 45rnrnrnrn我使用DAO定义了一个词典类:CMyDictionaryrnrn在MainFrm.cpp里面声明一个变量:CMyDictionary Dict;rnrnrn如果定义成一个全局变量,结果程序退出时就出现上述错误。rn如果在MainFrm.cpp的某个函数内部定义成一个局部变量,就没有任何问题。rnrnrn请高手看看,<em>怎么回事</em>儿。rnrn解决后马上结帖。本人的结帖率100%,呵呵。
求助:Debug Assertion Failed! FIle:afxhtml.inl Line 57
跟踪,错误在 Create一个自定义控件时出现的。rn但奇怪的是,在被人机子编译出来的文件在别人机子上没有问题rn别人机子编译出的文件在我的机子没有问题。rn而我编译出的文件在别人机子上也有问题。rn哪位见过类似问题?是不是跟VC有关系?rn谢谢!
(在线等。急)Debug Assertion Failed! File: wincore.cpp Line:1002
现象:rn创建一mfc应用程序项目,类型:基于对话框。其他默认。rn然后在Dialog资源中添加一button,创建该button的控件变量,类型为CBitmapButtonrn编译运行ok。 但是退出程序时出现错误:rnDebug Assertion Failed! rnFile: wincore.cpp rnLine:1002rnrnwincor.cpp: rn998 if (pWnd != NULL)rn999 rn1000 // Should have been detached by OnNcDestroyrn1001 #ifdef _DEBUGrn1002 ASSERT(pMap->LookupPermanent(hWndOrig) == NULL);rn1003 #endifrn1004 rnrnrn(release编译ok)rnrn注:程序肯定没问题。在以前肯定也是能运行的,故怀疑为开发环境问题(Visual Stdio.net 2003)rn请高手指点。
求助!Debug Assertion Failed! fprintf.c Line:56
rn这是一个命令按钮相应函数,目的是拼接Data1.txt和Data2.txt中相同卷号的信息,存入Data.txt中。rn调试发现:当j==507,i=1850时,出现题目所示错误;rnvoid C__Dlg::OnPipei() rnrn SetDlgItemText(IDC_PIPEI,"入口卷号匹配中……");rn FILE* fp1;rn FILE* fp2;rn FILE* fp;rn char stmp[100];rn CString Pathname1;rn CString Pathname2;rn CString Pathname;rnrn Pathname1="Data1.txt";//读文件,包含钢卷的部分信息rn Pathname2="Data2.txt";//读文件,包含钢卷的另一部分信息rn Pathname="Data.txt";//目标文件,组合钢卷的两部分信息rnrn int num1=CountLines(Pathname1)-2;//计算Data1.txt文件有效行数,59831行rn int num2=CountLines(Pathname2)-2;//计算Data2.txt文件有效行数,7825行rn rn char steel_code[20];rn double width,hin,speed,tout,ep,p,tin;rn char coin_in1[20],coin_in2[20];//存放两个文件里的钢卷号rnrn fp=fopen(Pathname,"w");rn fprintf(fp,"%s\t","出钢记号");rn fprintf(fp,"%s\t","宽度");rn fprintf(fp,"%s\t","速度");rn fprintf(fp,"%s\t","厚度");rn fprintf(fp,"%s\t","出口张力"); rn fprintf(fp,"%s\t","延伸率");rn fprintf(fp,"%s\t","轧制力");rn fprintf(fp,"%s\n","入口张力");rn fclose(fp);rnrn fp1 = fopen(Pathname1,"r");rn if(fp1 == NULL)rn MessageBox("Can't open <em>file</em> Data1.txt");rn for(int ch1=0;ch1,stmp);rn for(int j=0;j
Debug assertion failed wincore.cpp line:639 求教!
代码如下:[code=C/C++]rnint CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) rnrn if (CFrameWnd::OnCreate(lpCreateStruct) == -1)rn return -1;rnrn if(!m_wndView.Create(WS_CHILD | WS_VISIBLE | LBS_USETABSTOPS |rn LBS_SORT | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT, CRect(0, 0, 0, 0),rn this, AFX_IDW_PANE_FIRST))rn return -1;rnrn return 0;rnrnm_wndView是CPhonesView类型的,CPhonesView是从CPhonesListBox继承而来的类,CPhonesListBox是从CListBox继承而来的类。请高手指点!rn[/code]rnrn还有另外一个程序运行正常,但是当关闭应用程序时,会出现, degug <em>assertion</em> <em>failed</em> dbgheap.c <em>line</em>:1044. 请高手指点,多谢!rn
网络通信错误:Debug Assertion failed :line servercore.cpp
[img=https://img-bbs.csdn.net/upload/201403/16/1394938632_305329.jpg][/img]rn这种问题怎么解决,求大神指点!
occcont.cpp line 925运行错误 Debug Assertion Failed
编译正确,运行时显示:rn运行程序,显示rnDebug Assertion Failedrnprograme: c:\windows\system32\xxx.dllrn<em>file</em>:E:\programs\vctools\occcont.cpprn<em>line</em>:925rnrn第925行有一个断言( ASSERT(。。。。。) )这个断言条件(即ASSERT后括号里的条件)在调试的时候没有得到满足,所以抛出了这个断言错误。但我想程序在别的机器上肯定可以跑,换了台机器就出错,应该不是代码问题,而是哪里设置不对。rnrn再看Debug窗口里的Trace信息如下:rn control 6262d3a0-531b-11cf-91f6-c2863c385e30 <em>failed</em>.rn>>> Result code: 0×80040154rn>>> Is the control is properly registered?rnWarning: Resource items and Win32 Z-order lists are out of sync. Tab order may be not defined well.rnrn查看Result Code:0×80040154,发现是REGDB_E_CLASSNOTREG错误。结合下面的提示语句,Is the control is properly registered?。猜想是某个控件未被注册。然后查找 control的CLSID6262d3a0-531b-11cf-91f6-c2863c385e30,发现是控件FlexGrid Control 6.0。该控件包含在Msflxgrd.ocx文件中。在网上下载该控件,因为是64位机器,将该文件拷贝入机C:\Windows\SysWOW64中,然后在命令提示符以及再以管理员身份两次注册:regsvr32 C:\Windows\SysWOW64\Msflxgrd.ocx。再次编译运行,顺利通过。rnrn
help!Debug Assertion Failed line:639
小弟现在在做个ODBC连接access的程序.我原来都好好的,就是数据库加了一列后,我就改了下对应的Recordset,给他增加一个变量,后来点view ->classWizard后就有个对话框问我什么被修改了之类的,我点确定后运行就有这个错误了.rnFile:wincore.cpprn<em>line</em>:639rn调试发现整个对话框都能调过,就是显示不出来.在错误框按重试进入到wincore.cpp,是这个语句调不了:ASSERT(pWnd->m_hWnd == NULL);但我还是一点头绪都没有,不知道怎么改.rn我把wincore.cpp出错那个函数也贴出来:rnvoid AFXAPI AfxHookWindowCreate(CWnd* pWnd)rnrn _AFX_THREAD_STATE* pThreadState = _afxThreadState.GetData();rn if (pThreadState->m_pWndInit == pWnd)rn return;rnrn if (pThreadState->m_hHookOldCbtFilter == NULL)rn rn pThreadState->m_hHookOldCbtFilter = ::SetWindowsHookEx(WH_CBT,rn _AfxCbtFilterHook, NULL, ::GetCurrentThreadId());rn if (pThreadState->m_hHookOldCbtFilter == NULL)rn AfxThrowMemoryException();rn rn ASSERT(pThreadState->m_hHookOldCbtFilter != NULL);rn ASSERT(pWnd != NULL);rn ASSERT(pWnd->m_hWnd == NULL); // only do oncern//就是上面这条语句出错**********rn ASSERT(pThreadState->m_pWndInit == NULL); // hook not already in progressrn pThreadState->m_pWndInit = pWnd;rn
Assertion Failed! File wincore.cpp line 1034.
出现了这种错误,都不知道怎么办好,还请各位大哥请教
毕业设计求救!!!Debug Assertion Failed!...File: afxcmn.inl...
我把程序打包上传,下载地址:rnrn[url=http://www.fs2you.com/<em>file</em>s/6019ccc5-0a4b-11dd-b6ab-0014<em>22</em>1f3995/]http://www.fs2you.com/<em>file</em>s/6019ccc5-0a4b-11dd-b6ab-0014<em>22</em>1f3995/[/url]rnrn将数据库还原到SQLServer,调试通过,运行,用户名和密码都是1,只有会员-〉会员管理是可用的,点击它之后就出现这样的问题了,请高高手帮我看看,肯定是DlgVIP里的问题啊!
Debug Assertion Failed !
我这几天做一个小程序,主要是显示位图,主窗体是用CFormView ,开始我只是打开显示一个位图(正常), 后来我在CXXXView::OnInitialUpdate()里加入m_yc.Create(IDD_LEFT_FORM,this) 其中m_yc是一个CDialog类型的(对应的对话框是IDD_LEFT_FORM ,我加入这个Child Style的对话框是想在主窗体的左边出现IDD_LEFT_FORM)。 编译通过程序初始化也正常,但是在打开位图时出问题了:位图可以显示,但出现Debug Assertion Failed !对话框,说是wincore.exe错误,在第639行:rnBOOL AFXAPI AfxUnhookWindowCreate()rnrn _AFX_THREAD_STATE* pThreadState = _afxThreadState.GetData();rn#ifndef _AFXDLLrn if (afxContextIsDLL && pThreadState->m_hHookOldCbtFilter != NULL)rn rn ::UnhookWindowsHookEx(pThreadState->m_hHookOldCbtFilter);rn pThreadState->m_hHookOldCbtFilter = NULL;//本行出错!!!rn rn#endifrn if (pThreadState->m_pWndInit != NULL)rn rn pThreadState->m_pWndInit = NULL;rn return FALSE; // was not successfully hookedrn rn return TRUE;rnrnrn这是怎么一回事哦?? 大家帮帮忙
Debug Assertion Failed错误?
我是VC菜鸟,用F5调试时,执行中出现一个提示框:rnrnDebug Assertion FailedrnrnFile: dbgheap.crnLine 1017rnrn.....rnrn原因是什么
Debug Assertion Failed!问题
我按照书上的例子把程序做好rn运行的时候出现Debug Assertion Failed!rn我无法做出对应的解决方案rn请高手出马rn
Debug Assertion Failed什么意思?
在调试一个程序的时候,没有语法错误,执行后就跳出对话框来说:Debug Assertion Failed,怎样才能避免?rnrn我的程序如下:rnrn//BinaryTree.hrn // 二叉树类 //rn#includernusing namespace std;rnrntemplate class BinaryTree;rnrntemplate class BinTreeNodernrn friend class BinaryTree;rn public:rn BinTreeNode():LeftChild(NULL),RightChild(NULL)rn rn BinTreeNode( T Item,BinTreeNode* Left=NULL,BinTreeNode* Right=NULL):Data(Item),LeftChild(Left),RightChild(Right)rn rn T GetData() const rn rn return Data;rn rn BinTreeNode* GetLeft() const rn rn return LeftChild;rn rn BinTreeNode* GetRight() const rn rn return RightChild;rn rn void SetData(const T& Item)rn rn Data=Item;rn rn void SetLeft(BinTreeNode* L)rn rn LeftChild=L;rn rn void SetRight(BinTreeNode* R)rn rn RightChild=L;rn rn private:rn BinTreeNode* LeftChild, * RightChild;rn T Data;rn;rnrntemplate class BinaryTreernrn public:rn BinaryTree():Root(NULL)rn rn BinaryTree(T Value):RefValue(Value),Root(NULL)rn rn virtual ~BinaryTree()rn rn Destroy(Root);rn rn virtual int IsEmpty()rn rn return Root==NULL?1:0;rn rn virtual BinTreeNode *LeftChild(BinTreeNode* Current)rn rn return Root!=NULL?Current->LeftChild:NULL;rn rn virtual BinTreeNode *RightChild(BinTreeNode* Current)rn rn return Root!=NULL?Current->RightChild:NULL;rn rn const BinTreeNode* GetRoot() constrn rn return Root;rn rn void SetRoot(BinTreeNode* TheRoot)rn rn Root=TheRoot;rn rn private:rn BinTreeNode *Root;rn T RefValue;rn BinTreeNode* Parent(BinTreeNode* Start,BinTreeNode *Current);rn void Destroy(BinTreeNode* Current);rn;rnrntemplatevoid BinaryTree::Destroy(BinTreeNode* Current)rnrn if (Current!=NULL)rn rn Destroy(Current->LeftChild);rn Destroy(Current->RightChild);rn delete Current;rn rnrnrntemplate BinTreeNode* BinaryTree::Parent(BinTreeNode* Start,BinTreeNode *Current)rnrn if(Start==NULL) return NULL;rn if(Start->LeftChild==Current|| Start->RightChild==Current)rn return Start;rn BinTreeNode* p;rn if ((p=Parent(Start->LeftChild,Current))!=NULL)rn return p;rn else return Parent(Start->RightChild,Current);rnrnrn//Main.cpprnrn#include rn#include "BinaryTree.h"rn//using namespace std;rnrnvoid main()rnrn BinTreeNode TestNode;rn BinTreeNode Test2Node;rn BinTreeNode* pNode;rn BinaryTree TestTree; rnrn Test2Node.SetData(3);rn TestNode.SetData(8);rn TestNode.SetLeft(&Test2Node);rn pNode=&TestNode;rn TestTree.SetRoot(pNode);rnrn cout<
Debug Assertion Failed!错误
编译时出现以下错误:rnrnDebug Assertion Failed!rnProgram:.... am Files\microsoft visuall studio\MyProjects\Pwd\Debug\pwd.exernrn<em>file</em>:dlgData.cpprnLine:624rnFor information on how your program can cause an asserttion failure,see the visual c++ documentattion on asserts.rn(press retry to <em>debug</em>y the applicatio)rnrn以上是弹出对话框的内容,以下是源程序的一部分.rn这是什么问题,怎么解决???
Debug Assertion Failed错误
[code=C/C++][/code]rn#includernusing namespace std;rn//利用附加数组重排数组元素rntemplaternvoid Rearrange(T *&a, int n, int r[])rn//按序重排数组a中的元素,使用附加数组urn T *u = new T[n+1];rn //在u中移动到正确的位置rn for (int i=0; irnvoid Rank(T a[], int n, int r[])rn// Rank the n elements a[0:n-1].rn for (int i = 0; i < n; i++)rn r[i] = 0; // initializern // compare all element pairsrn // Visual complains if we say int i againrn for (int i = 1; i < n; i++)rn rn for (int j = 0; j < i; j++)rn rn if (a[j] <= a[i]) r[i]++;rn else r[j]++;rn rn rn;rnrn//Swap函数rntemplaternin<em>line</em> void Swap(T&a, T&b)rn rn T temp = a;rn a = b;rn b = temp;rn;rn//主函数rnvoid main()rnrn int n = 5;rn int *x = new int[5];rn int y[5] = 5, 9, 2, 7, 0;rn for (int i=0; i
Debug Assertion Failed!错误问题
写了一个网络捕包的小程序,在vc6.0 运行正常,在2005下出错,编译没有问题,运行中弹出对话框rn错误如下,rn Debug Assertion Failedrn <em>file</em>:isctype.crn <em>line</em>:56rn Expression:(unsinged)(c+1);rn rn *string = 0;rn return ascii_string;rnrn[/code]rn问题:rn1. vc2005中的判断可打印字符的函数是否为isgraph?rn2. vc2005中如何正确显示网络包中的数据?rn谢谢rnrn
Debug Assertion Failed 问题?
在vc中我做了一个界面,只想把表中的字段用编辑框显示出来,点击Adodc控件的下条记录,上条记录等就能讲表中的字段显示在相应的编辑框中,我不知道要在哪里写代码,就写在MoveComplete事件里,不知道对不对,运行后出现这样的错误框rn显示Debug Assertion Failed 错误,我是新手,不知道要怎么解决,求大家帮下忙!rnrnvoid CDeptDlg::OnMoveCompleteAdodc1(long adReason, LPDISPATCH pError, long FAR* adStatus, LPDISPATCH pRecordset) rn_RecordsetPtr m_pRecordset;rn rn m_pRecordset.CreateInstance(__uuidof(Recordset)); //创建RecordSet实例rn pRecordset->QueryInterface(IID_IDispatch, (void **)&m_pRecordset);rn if(! m_pRecordset->adoEOF)rn rn m_DeptId=m_DataGrid.GetItem(0);rn m_DeptName=m_DataGrid.GetItem(1);rn UpdateData(FALSE);rn rn else rn m_pRecordset->MoveFirst();rn while (!m_pRecordset->adoEOF)rn rn m_DeptId=m_DataGrid.GetItem(0);rn m_DeptName=m_DataGrid.GetItem(1);rn UpdateData(FALSE);rn rn
Debug Assertion Failed!
fputc的参数传递有问题,不知道怎么改,还望各位指点不胜感激rn[img=https://img-bbs.csdn.net/upload/201605/19/1463635273_367811.png][/img][img=https://img-bbs.csdn.net/upload/201605/19/1463635442_654717.png][/img]
关于Debug Assertion Failed
[img=https://img-bbs.csdn.net/upload/201410/02/141<em>22</em>32023_453340.png][/img]rnvs212 mfc编程,应该是数据库导入和指针的问题(我猜的)rn1.我先在stdafx.h中添加如下代码rn#import "C:\Program Files\Common Files\System\ado\msado15.dll" rename("EOF","adoEOF")rename("BOF","adoBOF")rnusing namespace ADODB;rn这步貌似没问题rn2.需要将_ConnectionPtr m_pConnection;_RecordsetPtr m_pRecordset;这两个指针添加到对应的dlg.h的类中rn因为我建立的是单文档的应用,所以我是将这两个指针放入该界面的头文件中了rn3.将如下代码放入初始化函数中,rn if(!AfxOleInit())rn rn rn try rn rn m_pConnection.CreateInstance(__uuidof(Connection)); rn m_pConnection->Open("Provider=SQLOLEDB;server=LEE-PC;Uid=sa;Pwd=1104103<em>22</em>li;Database=MAF","","",adModeUnknown);rn rn catch(_com_error e) rn rn AfxMessageBox(e.Description()); rn rnrnrn运行时,进行到用到数据库的地方就出现如图的Debug Assertion Failedrn感觉是不是2,3步代码放的文件的位置不对?
Debug Assertion Failed
如题,一般是什么问题?如何解决?谢谢
vs2008 debug assertion failed
[img=http://img.my.csdn.net/uploads/201211/14/1352857313_8587.jpg][/img]rn重试中断,显示出错位置在这rn[img=http://img.my.csdn.net/uploads/201211/14/1352857<em>22</em>7_3586.jpg][/img]rn昨天还可以的,今天就不行了,不知道为什么,求高手指点rnrn
Debug Assertion Failed请教
我编写了一个udp接收程序,编译通过了,点击发送按钮后出现Debug Assertion Failed错误,<em>file</em>core.cpp <em>line</em> 342rnvoid CFile::SetLength(DWORD dwNewLen)rnrn ASSERT_VALID(this);rn [color=#FF0000]ASSERT(m_hFile != (UINT)hFileNull);[/color]rnrn Seek((LONG)dwNewLen, (UINT)begin);rnrn if (!::SetEndOfFile((HANDLE)m_hFile))rn CFileException::ThrowOsError((LONG)::GetLastError());rnrn就是红色标记的那一行出了错误,请问该怎么解决呢
Debug Assertion Failed!!!
我用视频编解码器.exe 执行文件,解码一个视频文件时,也就播放了2,3秒就报出这个错误了。rnDebug Assertion Failed!rnprogram :。。。。。。\ \\\视频编解码器.exe rnFile:dbgheap.crnLine:1044rnExpression:_CrtIsValidHeapPointer(pUserData)rnrnFor information on how your program can cause an <em>assertion</em> failure,see the Visual C++ documentation on assert。该窗口下面有两个按钮 终止 调试 。rnrnrn之后马上弹出一个标题为“应用程序错误”的窗口。显示内容如下:rn 应用程序发生异常 unknown software exception(0x80000003),位置为0x7c92120e.rn要终止程序,请单击“确定”。rn要调试程序,请单击“取消”。rnrn希望遇到过类似错误的朋友帮忙解答下,我不知道如何改正,找到了dbgheap.C文件,不懂错在那里???
Debug Assertion Failed! afxcoll.inl
Program: *.exernFile: afxcoll.inlrnLine: 319rnrnrn不知道是错在哪里。。。请教各位大虾~~
debug assertion failed
vc6调试程序跳出此框,<em>file</em>:<em>afxwin1.inl</em>,<em>line</em> : <em>22</em>
关于Debug Assertion Failed!
#includern#includern#includernrn#define <em>file</em>name (c:\\zj.txt) //文件位置 rn#define N 100 //最大员工数 rntypedef struct memberrnrn char name[20];rn int no;rn char sex[10];rn char birthday[30];rn char marry[10];rn int child; rnST;rnST jober[N]; //公会成员rnrn/************************************rn 登陆函数rn*************************************/ rnvoid login()rnrn char password[20] , username[20];rn char name[20] , word[20];rn int flag = 0;rn FILE *fp = NULL;rn if( NULL == (fp=fopen("c:\\zj.txt","rb+")) )rn rn printf("不能打开文件请查找C盘根目录下是否有zj.txt!");rn getchar();rn exit(1);rn rn fread(username,sizeof(username),1,fp);rn fread(password,sizeof(password),1,fp);rn printf("请输入用户名和密码并用空格隔开(默认用户名密码admin admin):");rn while(flag < 3)rn rn scanf("%s %s",&name[0],&word[0]);rn if(strcmp(username,name) == 0 && strcmp(password,word) == 0)rn break;rn elsern rn printf("用户名或密码错误请重新输入:");rn flag++; rn rn rn fclose(fp);rn fp = NULL;rn if(flag>2)rn rn printf("密码错误次数过多 退出系统!!!");rn getchar();rn getchar();rn exit(1);rn rnrnrn/************************************rn 函数声明区rn************************************/rnvoid input(ST *a);rnint select();rnvoid pandect();rnrnint main(void)rn rn int x = 0; rn login();rn while(1)rn rn printf("\n*******************************************\n");rn printf("* *\n");rn printf("* 欢迎进入公会成员管理系统 *\n");rn printf("* *\n"); rn printf("* 请选择您需要的功能 *\n");rn printf("* 1:工会成员信息录入 *\n");rn printf("* 2:工会成员浏览 *\n");rn printf("* 3:查询工会成员信息 *\n");rn printf("* 4:工会成员信息删除 *\n");rn printf("* 5:工会成员信息修改 *\n");rn printf("* 6:修改密码 *\n");rn printf("* 7:退出程序 *\n");rn printf("* *\n");rn printf("*******************************************\n");rn scanf_s("%d",&x,1);rn switch(x)rn rn case 1: input(jober); break;rn case 2: pandect(); break;rn case 3: ;break;rn case 4: ;break;rn case 5: ;break;rn case 6: ;break;rn case 7:exit(1);break;rn default: ;break;rn rn rn rnreturn 0;rnrn/***********************rn 选择Y / Nrn 返回值0或者1rn************************/rnint select()rnrn char tmp;rn scanf("%c",&tmp);rn if(tmp == 89 || tmp == 67)rn return 1;rn else if(tmp == 78 || tmp == 46)rn return 0;rn elsern rn printf("输入错误 请重新输入!!!");rn select();rn rnrnrn/************************rn 信息录入rn*************************/rnvoid input(ST *a)rnrn FILE *fp = NULL;rn int x = 1;rn fp=fopen("c:\\zj.txt","ab+");rn while(x)rn rn printf("请输入成员姓名,工号,性别,生日,婚否,子女数 并用空格隔开:");rn printf("\n ");rn scanf("%s %d %s %s %s %d",a->name,&(a->no),a->sex,a->birthday,a->marry,&(a->child));rn fwrite(a,sizeof(ST),1,fp);rn printf("请问还需要录入吗? Y/N :");rn printf("\n");rn x = select();rn rn fclose(fp);rn fp = NULL;rnrnrn/************************rn 信息总览rn************************/rnvoid pandect()rnrn FILE *fp = NULL;rn int x = 0;long t;rn fp = fopen("c:\\zj.txt","rb+");rn fseek(fp,0L,2);rn t = ftell(fp);rn rewind(fp);rn t = t/sizeof(ST);rn printf("公会成员数:%d\n",t);rn fseek(fp,40L,0);rn fread(jober,sizeof(ST),100,fp);rn while(x < t)rn rn printf("姓名:%s 工号:%d 性别:%s \n生日:%s 婚否:%s 子女数:%d \n",jober[x].name,jober[x].no,jober[x].sex,jober[x].birthday,jober[x].marry,jober[x].child);rn printf("\n");rn x++;rn fclose(fp);rn fp = NULL;rn rn
出现debug assertion failed
[code=c]#includern#includernusing namespace std;rnstruct candyrnrn string brand;rn double weight;rn int calory;rn;rnint main()rnrn candy *snack=new candy[3];rn snack[0].brand="Macho Munch";rn snack[0].weight=2.3;rn snack[0].calory=350;rn snack[1].brand="Macho Munch";rn snack[1].weight=2.3;rn snack[1].calory=350;rn snack[2].brand="Macho Munch";rn snack[2].weight=2.3;rn snack[2].calory=350;rn for(int i=0;i<
Debug Assertion Failed问题
Debug Assertion Failedrnd:\programe\^^^^^rnFILE afx.inlrnLINE 177rnrn对应的代码rn_AFX_INLINE TCHAR CString::operator[](int nIndex)constrnrnASSERT(nIndex>=0);rnASSERT(nIndexnDataLength);rnreturn m_pchData[nIndex];rnrn如何解决.高手指点.rnrn
Debug Assertion Failed!
用VS2008编译,,出错!新手,大家不吝指教啊rnrnrnProgram:f;\VS\Convolution_first\Debug\Convolution_first.exernFile: f:\dd\vctools\crt_bld\self_x86\crt\src\fprintf.crnLine:55rnrnrnExpression:(str!=NULL)rnrnFor information on how your program can cause <em>assertion</em> failure,see the Visual C++ documentation on asserts.rnrnrn我的主函数:rn#include "head.h"rnrnrn int Message0[(L+m)];rn int Message1[(L+m)];rn int Encoded0[(L+m)];rn int Encoded1[(L+m)];rn int Encoded2[(L+m)];rnrn int Transmitted0[(L+m)];rn int Transmitted1[(L+m)];rn int Transmitted2[(L+m)];rnrn double Received0[(L+m)];rn double Received1[(L+m)];rn double Received2[(L+m)];rnrn int Output0[(L+m)];rn int Output1[(L+m)];rn int Output2[(L+m)];rnrn int Decoded0[(L+m)];rn int Decoded1[(L+m)];rn rnrn int Trellis_next[8][4],Trellis_current[8][4], Trellis_Code[8][4];rn double SIGMA;rn double BER;rnchar name[80]="CON.dat";rnFILE *fp;rnint state=(int)time(NULL);rnrnint main()rnrn srand((unsigned)time(NULL)); rn fp=fopen(name,"w");rnrn fprintf(fp," EbNo BER\n");rn rn //int total_num;rn int i;rn int error_frame;rn int total_num;rn double EbNo,No;rn unsigned int errbit;rnrn rn for(EbNo=INIT;EbNo!=FINAL+1;EbNo+=SNRINC) //set Eb=1;rn rn errbit =0;rn error_frame=0;rn total_num =0;rn No =1.0/pow(10.0,EbNo/10.0);rn SIGMA =sqrt(No/2);rn rn while(error_frame
关于:Debug Assertion Failed
我的程序编译,构件均通过,一执行就出现rnDebug Assertion FailedrnFile:appcore.cpprnLine: 85 / 355 等多行错误rn若按忽略,最后程序不能执行下去。后来我把原来的语句注释掉仍然有该错误。rn这是什么错误, 如何解决.
debug assertion failed 出错
运行程序时出错,显示<em>debug</em> <em>assertion</em> <em>failed</em> ,出错是<em>怎么回事</em>,大哥们rn#include rn#include rnrnint main()rnrn FILE *fp=fopen("C:\\Documents and Settings\\Administrator\\桌面\\test.txt", "r");rn float arr[3][2], *p;rn int i, j;rn rn p = (float *)arr;rn for(i=0; i);rn return 0;rnrnrnrnrnrnrn
Debug Assertion Failed错误问题
各位高手:rn 我写了一个OCX程序,功能是在网页中点击按钮后会启动一个对话框。现在的问题是刚打开网页点击按钮没什么问题,但当我将启动的对话框关闭后再重新点击按钮时,就会报出如下错误:rnDebug Assertion Failed!rnProgram :c\Program File\Internet Explorer\IEXPLORER.EXErnFile:winocc.cpprnLine:279rnrnFor information on how your program can cause an <em>assertion</em> failure,see the Visaul C++ documentation on asserts.rn(Press Retry to <em>debug</em> the application)rnrn当点击忽略后程序依然能够正常运行。就是说打开网页后第一次启动对话框不会报错,后面再启动时就会报错。rnrn请问问题出在哪里?谢谢高手们了。
Debug Assertion Failed,救我
program :F:\Server\Debug\Server.exernFile:afxcmn2.inlrnLine:303rnrn什么意思?rn望大虾指教rn
又见debug assertion failed
多路串口程序,写串口后,读串口数据进行分析。限于数据量大及硬件设备的配置,程序基本无法使用开发用的电脑来进行跟踪调试。rnrn运行两路串口时,正常。但运行三路串口时,release版本,运行取得正常结果,然后程序马上自动关闭。而<em>debug</em>版本,运行取得正常结果,然后马上弹出我想大家都见过的“<em>debug</em> <em>assertion</em> <em>failed</em>”.点“忽略”,则可以继续使用软件。rnrnas following:rn````````````````````````````````````````````````````````rnDebug Assertion Failed!rnrnProgram: ..path...\xxxx.exernFile:afxole.inlrnLine:277rnrnFor information on how your program can cause an <em>assertion</em> failure, see the visual c++ documentation on asserts.rnrn```````````````````````````````````````````````````````rnrn可从哪些方面的原因进行判断和诊断?——(最好能通过分析直接解决!!!)rn如果非要跟踪调试,请给出一些需要注意的事项和有用的技巧。rnrn先谢谢大家。今天累了,先回家休息,明天再来琢磨这个bug。谢谢rn
关于debug assertion failed!!!!
<em>debug</em> <em>assertion</em> <em>failed</em>!rnrn<em>file</em>:......\atlcom.hrn<em>line</em> 149rnrn HRESULT GetPropertyByName(LPCOLESTR lpsz, VARIANT* pVar)rn rn ATLASSERT(p); //<em>line</em> 149rn ATLASSERT(pVar);rn DISPID dwDispID;rn HRESULT hr = GetIDOfName(lpsz, &dwDispID);rn if (SUCCEEDED(hr))rn hr = GetProperty(p, dwDispID, pVar);rn return hr;rn rnrnrn有人碰到过这样的问题么?什么原因?
Debug assertion Failed?的问题
在运行时提示Debug <em>assertion</em> Failed?,rnFile:dlgdata.cpp rnLine: 308rn我点了 重试-取消-重试后,进入到调试器,跟踪到下列红颜色语句:rnvoid AFXAPI DDX_Radio(CDataExchange* pDX, int nIDC, int& value)rn // must be first in a group of auto radio buttonsrnrn HWND hWndCtrl = pDX->PrepareCtrl(nIDC);rnrn [color=#FF0000]ASSERT(::GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP);[/color] ASSERT(::SendMessage(hWndCtrl, WM_GETDLGCODE, 0, 0L) & DLGC_RADIOBUTTON);rn unused CXX0030: Error: expression cannot be evaluatedrnrn if (pDX->m_bSaveAndValidate)rn value = -1; // value if none foundrn请问该如何修改!rn其间我删除了系统自动生成的一个按钮的函数,输入了新的函数,就出现了这种情况!rn
Debug Assertion Failed!!
我的是一个画线程序,折现的两端用小圆圈显示,用m_PointArray存储折线的端点坐标,m_PoingNum保存端点数目,但是当我加上红色的哪一行的时候就会出现Debug Assertion Failed!!这样的错误,这是为什么呢?请教各位大侠rnrnvoid CReadCoodinateView::MyDraw()rnrn CDC *pDC = GetDC(); //获取设备环境 rn int n=m_PointNum-1;rn /*根据坐标点绘出直线*/ rn for (int i = 0;iEllipse(m_PointArray[i].x-4,m_PointArray[i].y-4,m_PointArray[i].x+4,m_PointArray[i].y+4);rnrn pDC->MoveTo(m_PointArray[i].x,m_PointArray[i].y);rn pDC->LineTo(m_PointArray[i+1].x,m_PointArray[i+1].y); rn rn [color=#FF0000]pDC->Ellipse(m_PointArray[n-1].x-4,m_PointArray[n-1].y-4,m_PointArray[n-1].x+4,m_PointArray[n-1].y+4);[/color] ReleaseDC(pDC);rn
Debug Assertion Failed!(dllinit.cpp)
只有在<em>debug</em>版本时,我的工程运行时出现 Debug Assertion Failed!错误出现在dllinit.cpp内AfxFindResourceHandle(name,type)函数里,name为null。请问为什么名字会找不到?怎么办?
Debug Assertion failed!
编译后运行运行VC++2012对话框程序时,删除界面上Button 后,出现这样问题。rnrnProgram F:\xx\xx.exernFile:f:\dd\vctools\vc7libs\ship\atlmfc\src\wincore.cpp (我电脑中无此目录及文件)rn<em>line</em>:379rnrnfor information on how your grogram can cause an <em>assertion</em> failure,see the Visual C++ documentation on asserts.rnrn 中止,重试,忽略!rnrn rn 请问是什么错误?提示的路径是不存在的。谢谢各位了。VS2012太容易碰到这样错误了。
debug Assertion failed解决
我的这段代码为什么会引起中断呢,经断点调试发笑错误是如下:rnAFXCMN_INLINE BOOL CListCtrl::SetColumnWidth(int nCol, int cx)rn ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(m_hWnd, LVM_SETCOLUMNWIDTH, nCol, MAKELPARAM(cx, 0)); rnrnrnrn源代码如下,希望得到大神的帮忙,感激不尽啊!rnvoid CTabControlDlg::OnSize(UINT nType, int cx, int cy) rnrn rn CDialog::OnSize(nType, cx, cy);rn rn // TODO: Add your message handler code herern if(nType==SIZE_RESTORED||nType==SIZE_MAXIMIZED)rn rn if(nType==SIZE_MAXIMIZED)rn rn m_listctrl.SetColumnWidth(3,9<em>22</em>);rn rn else if(nType==SIZE_RESTORED)rn rn m_listctrl.SetColumnWidth(3,448);rn rn rn resize();rn rnrnrnrnvoid CTabControlDlg::resize()rnrn float fsp[2];rn POINT Newp; //rn CRect recta; rn GetClientRect(&recta); //rn Newp.x=recta.right-recta.left;rn Newp.y=recta.bottom-recta.top;rn fsp[0]=(float)Newp.x/Old.x;rn fsp[1]=(float)Newp.y/Old.y;rn CRect Rect;rn int woc;rn CPoint OldTLPoint,TLPoint; //rn CPoint OldBRPoint,BRPoint; //rn HWND hwndChild=::GetWindow(m_hWnd,GW_CHILD); //rn while(hwndChild) rn rn woc=::GetDlgCtrlID(hwndChild);//È¡µÃIDrn if(woc == IDC_LIST_MAIN)rn rn GetDlgItem(woc)->GetWindowRect(Rect);rn ScreenToClient(Rect); rn OldTLPoint = Rect.TopLeft(); rn TLPoint.x = long(OldTLPoint.x); rn TLPoint.y = long(OldTLPoint.y); rn OldBRPoint = Rect.BottomRight(); rn BRPoint.x = long(OldBRPoint.x *fsp[0]); rn BRPoint.y = long(OldBRPoint.y *fsp[1]); rn Rect.SetRect(TLPoint,BRPoint); rn GetDlgItem(woc)->MoveWindow(Rect,TRUE);rn rn else if(woc == IDC_BUTTON_CHINESE)rn rn GetDlgItem(woc)->GetWindowRect(Rect);rn ScreenToClient(Rect); rn OldTLPoint = Rect.TopLeft(); rn TLPoint.x = long(OldTLPoint.x*fsp[0]); rn TLPoint.y = long(OldTLPoint.y); rn OldBRPoint = Rect.BottomRight(); rn BRPoint.x = long(OldBRPoint.x *fsp[0]); rn BRPoint.y = long(OldBRPoint.y); rn Rect.SetRect(TLPoint,BRPoint); rn GetDlgItem(woc)->MoveWindow(Rect,TRUE); rn rn hwndChild=::GetWindow(hwndChild, GW_HWNDNEXT);rn rn Old=Newp;rn
DEBUG ASSERTION FAILED问题
代码如下:rn[code=c]#include rn#include rn#include rn#include rnHINSTANCE hinst;rnLRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM);rnBOOL InitApplication (HINSTANCE hInstance)rnrn WNDCLASSEX wcx;rn wcx.cbSize = sizeof (wcx);//WNDCLASSEX 的大小rn wcx.style = CS_HREDRAW | CS_VREDRAW;//从这个窗口类派生的窗口具有的风格rn wcx.lpfnWndProc = MainWndProc;//窗口处理函数的指针rn wcx.cbClsExtra = 0;//指定紧跟在窗口类结构后的附加字节数rn wcx.cbWndExtra = 0;//指定紧跟在窗口事例后的附加字节数rn wcx.hInstance = hInstance;//本模块的事例句柄rn wcx.hIcon = LoadIcon (NULL, IDI_APPLICATION);//图标的句柄rn wcx.hCursor = LoadCursor (NULL, IDC_ARROW);//光标的句柄rn wcx.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);//背景画刷的句柄rn wcx.lpszMenuName = NULL;//指向菜单的指针rn wcx.lpszClassName = "MYCLASS";//指向类名称的指针rn wcx.hIconSm = LoadIcon(NULL, IDI_WINLOGO);//和窗口类关联的小图标。如果该值为NULL。则把hIcon中的图标转换成大小合适的小图标rn return (RegisterClassEx (&wcx));rnrnHWND CreateEdit (HWND);rnBOOL InitInstance (HINSTANCE hInstance, int nCmdShow)rnrn HWND hwnd, hwndEdit;rn RECT rect;rn hwnd = CreateWindow (rn "MYCLASS",//WNDCLASSEX中定义的lpszClassNamern "NEW",//窗口标题rn WS_OVERLAPPEDWINDOW,//创建窗口的风格rn CW_USEDEFAULT,//指定窗口的初始水平位置rn CW_USEDEFAULT,//指定窗口的初始垂直位置rn CW_USEDEFAULT,//以设备单元指明窗口的宽度rn CW_USEDEFAULT,//以设备单元指明窗口的高度rn NULL,//指向被创建窗口的父窗口或所有者窗口的句柄rn LoadMenu (hInstance, MAKEINTRESOURCE(IDR_MENU1)),//菜单句柄rn hInstance,//程序实例的句柄rn (LPVOID) NULL);rn hwndEdit = CreateEdit (hwnd);rn ShowWindow (hwnd, nCmdShow);rn UpdateWindow (hwnd);rn if (!hwnd)rn rn return FALSE;rn rn elsern rn return TRUE;rn rnrnHWND CreateEdit (HWND hwndP)rnrn HWND hwnde;rn hwnde = CreateWindow (rn "EDIT",rn NULL,rn WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | ES_LEFT | ES_MULTILINE | ES_AUTOVSCROLL,rn CW_USEDEFAULT,rn CW_USEDEFAULT,rn CW_USEDEFAULT,rn CW_USEDEFAULT,rn hwndP,rn (HMENU)NULL,rn hinst,rn (LPVOID)NULL);rn ShowWindow (hwnde, SW_SHOW);rn UpdateWindow (hwnde);rn return hwnde;rnrnLRESULT CALLBACK MainWndProc (HWND hwnd,rn UINT uMsg,rn WPARAM wParam,rn LPARAM lParam)//消息处理函数rnrn CString lpFileName;rn CFileDialog Dia (TRUE);rn switch (uMsg)rn rn case WM_COMMAND:rn switch (LOWORD(wParam))rn rn case ID_40001:rn rn if (Dia.DoModal ()== IDOK)rn rn lpFileName = Dia.GetPathName ();rn MessageBox (NULL, lpFileName, "文件路径", MB_OK);//显示读取的文件路径rn rn break;rn rn default:rn break;rn rn break;rn case WM_DESTROY://窗口消失函数rn ExitThread (0);//线程终止rn break;rn default:rn return DefWindowProc (hwnd, uMsg, wParam, lParam);//系统默认消息处理函数rn rn UpdateWindow (hwnd);rnrnint WinMain (HINSTANCE hInstance,rn HINSTANCE hPrevInstance,rn LPSTR lpCmdLine,rn int nCmdShow)rnrn MSG msg;rn if (!InitApplication (hInstance))rn rn return FALSE;rn rn if (!InitInstance (hInstance, nCmdShow))rn rn return FALSE;rn rn while (GetMessage (&msg, (HWND)NULL, 0, 0))rn rn TranslateMessage (&msg);rn DispatchMessage (&msg);rn rn return msg.wParam;rnrn[/code]rn没弄懂咋回事...求解
Debug Assertion Failed! 求助
程序运行一小会就出现了这个问题。代码如下:rnDebug Assertion Failed! rnProgram: ****.exe rnFile: dbgheap.c rn<em>line</em>: 1044 rnrnExpression: _CrtIsValidHeapPoint(pUserData) rnrnFor information on how your program can cause an <em>assertion</em> failure, see the Visual C++ documentation on assertsrn调试堆栈是正在运行。rn代码如下:rn#ifdef _DEBUGrn#define new DEBUG_NEWrn#undef THIS_FILErnstatic char THIS_FILE[] = __FILE__;rn#endifrn// CAboutDlg dialog used for App Aboutrnclass CAboutDlg : public CDialogrnrnpublic:rn CAboutDlg();rnrn// Dialog Datarn //AFX_DATA(CAboutDlg)rn enum IDD = IDD_ABOUTBOX ;rn //AFX_DATArnrn // ClassWizard generated virtual function overridesrn //AFX_VIRTUAL(CAboutDlg)rn protected:rn virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV supportrn //AFX_VIRTUALrnrn// Implementationrnprotected:rn //AFX_MSG(CAboutDlg)rn //AFX_MSGrn DECLARE_MESSAGE_MAP()rn;rnrnCAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)rnrn //AFX_DATA_INIT(CAboutDlg)rn //AFX_DATA_INITrnrnrnvoid CAboutDlg::DoDataExchange(CDataExchange* pDX)rnrn CDialog::DoDataExchange(pDX);rn //AFX_DATA_MAP(CAboutDlg)rn //AFX_DATA_MAPrnrnrnBEGIN_MESSAGE_MAP(CAboutDlg, CDialog)rn //AFX_MSG_MAP(CAboutDlg)rn // No message handlersrn //AFX_MSG_MAPrnEND_MESSAGE_MAP()rnrn/////////////////////////////////////////////////////////////////////////////rn// CTempDlg dialogrnrnCTempDlg::CTempDlg(CWnd* pParent /*=NULL*/)rn : CDialog(CTempDlg::IDD, pParent)rnrn //AFX_DATA_INIT(CTempDlg)rn m_strT1 = _T("");rn m_strT10 = _T("");rn m_strT2 = _T("");rn m_strT3 = _T("");rn m_strT4 = _T("");rn m_strT5 = _T("");rn m_strT6 = _T("");rn m_strT7 = _T("");rn m_strT8 = _T("");rn m_strT9 = _T("");rn m_strTime = _T("");rn //AFX_DATA_INITrn // Note that LoadIcon does not require a subsequent DestroyIcon in Win32rn m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);rn m_bAutoSend=FALSE;rn m_bAutoTran=FALSE;rn m_nCycleTime=1000;rnrnrnrnvoid CTempDlg::DoDataExchange(CDataExchange* pDX)rnrn CDialog::DoDataExchange(pDX);rn //AFX_DATA_MAP(CTempDlg)rn DDX_Control(pDX, IDC_BUTTON_Send, m_ctrButtonSend);rn DDX_Control(pDX, IDC_EDIT_TIME, m_ctrTime);rn DDX_Control(pDX, IDC_EDIT_T9, m_ctrT9);rn DDX_Control(pDX, IDC_EDIT_T8, m_ctrT8);rn DDX_Control(pDX, IDC_EDIT_T7, m_ctrT7);rn DDX_Control(pDX, IDC_EDIT_T6, m_ctrT6);rn DDX_Control(pDX, IDC_EDIT_T5, m_ctrT5);rn DDX_Control(pDX, IDC_EDIT_T4, m_ctrT4);rn DDX_Control(pDX, IDC_EDIT_T3, m_ctrT3);rn DDX_Control(pDX, IDC_EDIT_T2, m_ctrT2);rn DDX_Control(pDX, IDC_EDIT_T10, m_ctrT10);rn DDX_Control(pDX, IDC_EDIT_T1, m_ctrT1);rn DDX_Text(pDX, IDC_EDIT_T1, m_strT1);rn DDX_Text(pDX, IDC_EDIT_T10, m_strT10);rn DDX_Text(pDX, IDC_EDIT_T2, m_strT2);rn DDX_Text(pDX, IDC_EDIT_T3, m_strT3);rn DDX_Text(pDX, IDC_EDIT_T4, m_strT4);rn DDX_Text(pDX, IDC_EDIT_T5, m_strT5);rn DDX_Text(pDX, IDC_EDIT_T6, m_strT6);rn DDX_Text(pDX, IDC_EDIT_T7, m_strT7);rn DDX_Text(pDX, IDC_EDIT_T8, m_strT8);rn DDX_Text(pDX, IDC_EDIT_T9, m_strT9);rn DDX_Text(pDX, IDC_EDIT_TIME, m_strTime);rn //AFX_DATA_MAPrnrnrnBEGIN_MESSAGE_MAP(CTempDlg, CDialog)rn //AFX_MSG_MAP(CTempDlg)rn ON_MESSAGE(WM_COMM_RXCHAR, OnCommunication)rn ON_WM_SYSCOMMAND()rn ON_WM_PAINT()rn ON_WM_QUERYDRAGICON()rn ON_BN_CLICKED(IDC_BUTTON_Send, OnBUTTONSend)rn ON_WM_TIMER()rn ON_EN_CHANGE(IDC_EDIT_TIME, OnChangeEditTime)rn //AFX_MSG_MAPrnEND_MESSAGE_MAP()rnrn/////////////////////////////////////////////////////////////////////////////rn// CTempDlg message handlersrnrnBOOL CTempDlg::OnInitDialog()rnrn CDialog::OnInitDialog();rnrn // Add "About..." menu item to system menu.rnrn // IDM_ABOUTBOX must be in the system command range.rn ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);rn ASSERT(IDM_ABOUTBOX < 0xF000);rnrn CMenu* pSysMenu = GetSystemMenu(FALSE);rn if (pSysMenu != NULL)rn rn CString strAboutMenu;rn strAboutMenu.LoadString(IDS_ABOUTBOX);rn if (!strAboutMenu.IsEmpty())rn rn pSysMenu->AppendMenu(MF_SEPARATOR);rn pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);rn rn rnrn // Set the icon for this dialog. The framework does this automaticallyrn // when the application's main window is not a dialogrn SetIcon(m_hIcon, TRUE); // Set big iconrn SetIcon(m_hIcon, FALSE); // Set small iconrn rn // TODO: Add extra initialization herern m_nBaud=9600;//波特率rn m_nCom=1;//串口号rn m_cParity='N';//奇偶校验rn m_nDatabits=8;//数据位rn m_nStopbits=1;//停止位rn m_dwCommEvents = EV_RXFLAG | EV_RXCHAR;rn CString strStatus;rn if (m_Port.InitPort(this, m_nCom, m_nBaud,m_cParity,m_nDatabits,m_nStopbits,m_dwCommEvents,512))rn rn m_Port.StartMonitoring();rn //"当前状态:串口打开,无奇偶校验,8数据位,1停止位");rn rn elsern rn AfxMessageBox("没有发现此串口");rn rn rn CEdit* pEdit=(CEdit*)GetDlgItem(IDC_EDIT_TIME);rn CString strText;rn strText.Format("%d",m_nCycleTime);rn pEdit->SetWindowText(strText); rnrn return TRUE; // return TRUE unless you set the focus to a controlrnrnrnvoid CTempDlg::OnSysCommand(UINT nID, LPARAM lParam)rnrn if ((nID & 0xFFF0) == IDM_ABOUTBOX)rn rn CAboutDlg dlgAbout;rn dlgAbout.DoModal();rn rn elsern rn CDialog::OnSysCommand(nID, lParam);rn rnrnrn// If you add a minimize button to your dialog, you will need the code belowrn// to draw the icon. For MFC applications using the document/view model,rn// this is automatically done for you by the framework.rnrnvoid CTempDlg::OnPaint() rnrn if (IsIconic())rn rn CPaintDC dc(this); // device context for paintingrnrn SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);rnrn // Center icon in client rectanglern int cxIcon = GetSystemMetrics(SM_CXICON);rn int cyIcon = GetSystemMetrics(SM_CYICON);rn CRect rect;rn GetClientRect(&rect);rn int x = (rect.Width() - cxIcon + 1) / 2;rn int y = (rect.Height() - cyIcon + 1) / 2;rnrn // Draw the iconrn dc.DrawIcon(x, y, m_hIcon);rn rn elsern rn CDialog::OnPaint();rn rnrnrn// The system calls this to obtain the cursor to display while the user dragsrn// the minimized window.rnHCURSOR CTempDlg::OnQueryDragIcon()rnrn return (HCURSOR) m_hIcon;rnrnLONG CTempDlg::OnCommunication(WPARAM ch, LPARAM port)rnrn CString str;rn str.Format("%02X ",ch);rn m_strRCV+=str;rn unsigned char dat[512];rnint a[512];rnint len1=Str2Hex(m_strRCV,dat);rnint i=0,k=0,j=0,n,l;rn//数据处理rnint f[512],d[512];rnn=len1/25;rnfor (l=0;l='0')&&(c='A')&&(c='a')&&(cGetWindowText(strText);rn m_nCycleTime=atoi(strText);rn rn
debug assertion failed 问题
不会传图...rn出现的错误对话款是 <em>debug</em> <em>assertion</em> <em>failed</em>!rnprogram:...rosoft visual studio\myprojects\medicalss\<em>debug</em>\medicalss.exern<em>file</em>:dlgdata.cpprn<em>line</em>:43rnrn这段应该就是导致错误的代码了rnCgood good;rnBOOL Ckcsp::OnInitDialog() rnrn CDialog::OnInitDialog();rn good.Open();rn m_list.InsertColumn(0,"药品编号");rn m_list.InsertColumn(1,"药品名称");rn m_list.InsertColumn(2,"药品单价");rn m_list.InsertColumn(3,"药品数量");rn m_list.InsertColumn(4,"药品总价");rn m_list.InsertColumn(5,"最大库存");rn m_list.InsertColumn(6,"最小库存");rn m_list.InsertColumn(7,"供货商");rnrn RECT rect;rn m_list.GetWindowRect(&rect);rn int wid=rect.right-rect.left;rn m_list.SetColumnWidth(0,wid/8);rn m_list.SetColumnWidth(1,wid/8);rn m_list.SetColumnWidth(2,wid/8);rn m_list.SetColumnWidth(3,wid/8);rn m_list.SetColumnWidth(4,wid/8);rn m_list.SetColumnWidth(5,wid/8);rn m_list.SetColumnWidth(6,wid/8);rn m_list.SetColumnWidth(7,wid/8);rn refresh();rnrn rn // TODO: Add extra initialization herern rn return TRUE; // return TRUE unless you set the focus to a controlrn // EXCEPTION: OCX Property Pages should return FALSErnrnrnvoid Ckcsp::refresh()rnrn m_list.DeleteAllItems();rn good.MoveFirst();rn int i=0;rn CString single,num,all,max,min;rn while(!good.IsEOF())rn rn m_list.InsertItem(i,good.m_G_code);rn m_list.SetItemText(i,1,good.m_G_name);rn single.Format("%d",good.m_G_single);rn m_list.SetItemText(i,2,single);rn num.Format("%d",good.m_Current_number);rn m_list.SetItemText(i,3,num);rn all.Format("%d",good.m_G_all);rn m_list.SetItemText(i,4,all);rn max.Format("%d",good.m_Max_number);rn m_list.SetItemText(i,5,max);rn min.Format("%d",good.m_Min_number);rn m_list.SetItemText(i,6,min);rn m_list.SetItemText(i,7,good.m_Provider_name);rn good.MoveNext();rn i++;rn rnrn rnm_list.SetExtendedStyle(LVS_EX_FULLROWSELECT);rngood.Close();rnrnrnrnrnF5-出错-重试 之后rnHWND CDataExchange::PrepareCtrl(int nIDC)rnrn ASSERT(nIDC != 0);rn ASSERT(nIDC != -1); // not allowedrn HWND hWndCtrl;rn m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);rn if (hWndCtrl == NULL)rn rn TRACE1("Error: no data exchange control with ID 0x%04X.\n", nIDC);rn[b] → ASSERT(FALSE);[/b] AfxThrowNotSupportedException();rn rn m_hWndLastControl = hWndCtrl;rn m_bEditLastControl = FALSE; // not an edit item by defaultrn ASSERT(hWndCtrl != NULL); // never return NULL handlern return hWndCtrl;rnrnrn加粗的这句 assert(false)是黄色箭头指向的位置 rnrnALT+7内容rnCDataExchange::PrepareCtrl(int 1002) <em>line</em> 43 + 25 bytesrnDDX_Control(CDataExchange * 0x0012ecdc, int 1002, CWnd & CWnd hWnd=0x00000000) <em>line</em> 626 + 12 bytesrnCmain::DoDataExchange(CDataExchange * 0x0012ecdc) <em>line</em> 34rnCWnd::UpdateData(int 0) <em>line</em> 3120rnCDialog::OnInitDialog() <em>line</em> 680 + 10 bytesrnAfxDlgProc(HWND__ * 0x00090940, unsigned int 272, unsigned int 854290, unsigned int 854290) <em>line</em> 35 + 14 bytesrnUSER32! 77d18734()rnUSER32! 77d2413c()rnUSER32! 77d23b30()rnUSER32! 77d3e599()rnUSER32! 77d18734()rnUSER32! 77d18816()rnUSER32! 77d2a013()rnUSER32! 77d2a998()rnCWnd::DefWindowProcA(unsigned int 272, unsigned int 854290, long 0) <em>line</em> 1011 + 32 bytesrnCWnd::Default() <em>line</em> 258rnCDialog::HandleInitDialog(unsigned int 854290, unsigned int 854290) <em>line</em> 624 + 8 bytesrnCWnd::OnWndMsg(unsigned int 272, unsigned int 854290, long 0, long * 0x0012f084) <em>line</em> 1826 + 17 bytesrnCWnd::WindowProc(unsigned int 272, unsigned int 854290, long 0) <em>line</em> 1596 + 30 bytesrnAfxCallWndProc(CWnd * 0x0012f484 Cmain hWnd=???, HWND__ * 0x00090940, unsigned int 272, unsigned int 854290, long 0) <em>line</em> 215 + 26 bytesrnAfxWndProc(HWND__ * 0x00090940, unsigned int 272, unsigned int 854290, long 0) <em>line</em> 379rnAfxWndProcBase(HWND__ * 0x00090940, unsigned int 272, unsigned int 854290, long 0) <em>line</em> <em>22</em>0 + 21 bytesrnUSER32! 77d18734()rnUSER32! 77d18816()rnUSER32! 77d2927b()rnUSER32! 77d2651a()rnUSER32! 77d2683e()rnUSER32! 77d39b43()rnCWnd::CreateDlgIndirect(const DLGTEMPLATE * 0x0041b9d0, CWnd * 0x0012fe6c CMedicalssDlg hWnd=???, HINSTANCE__ * 0x00400000) <em>line</em> 327 + 36 bytesrnCDialog::DoModal() <em>line</em> 531 + 32 bytesrnCMedicalssDlg::OnButton1() <em>line</em> 203rn_AfxDispatchCmdMsg(CCmdTarget * 0x0012fe6c CMedicalssDlg, unsigned int 1002, int 0, void (void)* 0x00401140 CMedicalssDlg::OnButton1(void), void * 0x00000000, unsigned int 12, AFX_CMDHANDLERINFO * 0x00000000) <em>line</em> 88rnCCmdTarget::OnCmdMsg(unsigned int 1002, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) <em>line</em> 302 + 39 bytesrnCDialog::OnCmdMsg(unsigned int 1002, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) <em>line</em> 97 + 24 bytesrnCWnd::OnCommand(unsigned int 1002, long 330024) <em>line</em> 2099rnCWnd::OnWndMsg(unsigned int 273, unsigned int 1002, long 330024, long * 0x0012f8d4) <em>line</em> 1608 + 28 bytesrnCWnd::WindowProc(unsigned int 273, unsigned int 1002, long 330024) <em>line</em> 1596 + 30 bytesrnAfxCallWndProc(CWnd * 0x0012fe6c CMedicalssDlg hWnd=???, HWND__ * 0x00040642, unsigned int 273, unsigned int 1002, long 330024) <em>line</em> 215 + 26 bytesrnAfxWndProc(HWND__ * 0x00040642, unsigned int 273, unsigned int 1002, long 330024) <em>line</em> 379rnAfxWndProcBase(HWND__ * 0x00040642, unsigned int 273, unsigned int 1002, long 330024) <em>line</em> <em>22</em>0 + 21 bytesrnUSER32! 77d18734()rnUSER32! 77d18816()rnUSER32! 77d2927b()rnUSER32! 77d292e3()rnUSER32! 77d4ff7d()rnUSER32! 77d465d2()rnUSER32! 77d25e94()rnUSER32! 77d3b082()rnUSER32! 77d18734()rnUSER32! 77d18816()rnUSER32! 77d189cd()rnUSER32! 77d18a10()rnUSER32! 77d274ff()rnUSER32! 77d3c6d3()rnCWnd::IsDialogMessageA(tagMSG * 0x00419b20 msg=0x00000202 wp=0x00000000 lp=0x000b001c) <em>line</em> 182rnCWnd::PreTranslateInput(tagMSG * 0x00419b20 msg=0x00000202 wp=0x00000000 lp=0x000b001c) <em>line</em> 3435rnCDialog::PreTranslateMessage(tagMSG * 0x00419b20 msg=0x00000202 wp=0x00000000 lp=0x000b001c) <em>line</em> 92rnCWnd::WalkPreTranslateTree(HWND__ * 0x00040642, tagMSG * 0x00419b20 msg=0x00000202 wp=0x00000000 lp=0x000b001c) <em>line</em> 2678 + 18 bytesrnCWinThread::PreTranslateMessage(tagMSG * 0x00419b20 msg=0x00000202 wp=0x00000000 lp=0x000b001c) <em>line</em> 672 + 18 bytesrnCWinThread::PumpMessage() <em>line</em> 848 + 30 bytesrnCWnd::RunModalLoop(unsigned long 4) <em>line</em> 3489 + 19 bytesrnCDialog::DoModal() <em>line</em> 539 + 12 bytesrnCMedicalssApp::InitInstance() <em>line</em> 59 + 8 bytesrnAfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f33, int 1) <em>line</em> 39 + 11 bytesrnWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f33, int 1) <em>line</em> 30rnWinMainCRTStartup() <em>line</em> 330 + 54 bytesrnKERNEL32! 7c817077()rnrn不知道是哪里错了 release也不行 会出现“试图执行系统不支持的操作”rn请大家帮忙看一下 谢谢 看看如何才能解决
Debug Assertion failed报错
程序的<em>debug</em>版在运行时出现Debug Assertion <em>failed</em>!报错,因为一时找不出错在那里,rn请问有其它的方法使<em>debug</em>版在运行时不出Debug Assertion <em>failed</em>!报错
VS2008 debug assertion failed
我在编写一个程序的时候(是Qt、OpenGL、C++),前几天还运行得好好的,今天添加了一个小功能之后,也可以编译运行,结果也是对的。但是关闭窗口之后出现错误对话框,如下图:rn[img=http://my.csdn.net/my/album/detail/119<em>22</em>17][/img]rnrn[url=http://my.csdn.net/my/album/detail/119<em>22</em>17][/url]rnrn很苦恼啊!rn有哪位大小以前遇到过这种错误的,能否告诉我一下造成这种错误的可能原因有哪些?rnrn感激不尽!rn
Debug Assertion Failed:(求助)
在使用WTL中的类CTabView 的.RemovePage(0)函数时,在<em>debug</em>下运行程序,一使用这个 函数就会弹出下图错误,rn在release下编译后使用程序,就没有问题,不知道什么原因,请高手帮忙。rnrn[img=http://img.my.csdn.net/uploads/201206/25/1340596781_<em>22</em><em>22</em>.png][/img]
请教-----Debug Assertion Failed。
今天写了一个二叉树的类,成员函数rntemplaternvoid BinaryTree::DelTree(BinaryNode* T_Root)rn if(T_Root!=NULL)rn DelTree(T_Root->left);rn DelTree(T_Root->right);rn delete T_Root;//************* rn rnrn目的是要清空以节点指针T_Root为根节点的二叉树。其中BinaryNode是包含数据域data,左后继节点left,右后继节点right的模板类,编译成功通过,但执行时出现下面的对话框rnDebug Assertion Failed rnExpression:_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)rnrn单步调试中删除最左边的叶子节点时//*************处出错。rn网上查到一些信息说是堆栈内存释放的问题,但没弄清楚是<em>怎么回事</em>,没有访问越界,也没有重复释放内存,可能是递归释放内存会有问题。请各位高手帮忙看一下,兄弟不胜感激!rn
Debug Assertion Failed!错误
本人正在做一个项目,是从别人那里接手过来的,接手的时候dialog上有一个多余的滑动块,我本想把他隐藏,但是隐藏之后运行还是能看见它,因此我就一气之下把它delete了,这下出了麻烦,运行的时候,显示<em>debug</em> <em>assertion</em> <em>failed</em>错误,我点了重试之后,中断到了dlgdata.cpp中的一行,具体代码如下:rn[code=c]HWND CDataExchange::PrepareCtrl(int nIDC)rnrn ASSERT(nIDC != 0);rn ASSERT(nIDC != -1); // not allowedrn HWND hWndCtrl;rn COleControlSite* pSite = NULL;rn m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl);rn if (hWndCtrl == NULL)rn rn // Could be a windowless OCXrn pSite = m_pDlgWnd->GetOleControlSite(nIDC);rn if (pSite == NULL)rn rn TRACE(traceAppMsg, 0, "Error: no data exchange control with ID 0x%04X.\n", nIDC);rn ASSERT(FALSE);rn AfxThrowNotSupportedException();rn rn rn m_idLastControl = nIDC;rn m_bEditLastControl = FALSE; // not an edit item by defaultrnrn return hWndCtrl;rn[/code]rn中断到了ASSERT(FALSE);这一行了。rn以前我也遇到过<em>debug</em>这种错误,但是都是因为野指针问题,这次真的不知道怎么修改了,求大神们帮忙!
debug Assertion Failed
各位仁兄帮帮忙rnrn我编的程序用的是单文档多视图,用到了消息映射rn我在一个视中点击一个BUTTON发送消息给主框架 rnsprintf(message,"发行信息显示");rn::SendMessage(theApp.m_pMainWnd->m_hWnd,MYMESSAGE,0,(LPARAM)message);rnrn在主框架中创建消息函数ShowInfo(WPARAM wParam,LPARAM lParam),接收消息rn CInfoView* m_pinfoview=(CInfoView*) AfxGetApp();rn m_pinfoview->ShowInfo((LPTSTR)lParam);rnrn想在在另一个视中用EDIT控件显示这个消息rnvoid CInfoView::ShowInfo(CString info)rnrnrn m_edit.SetDlgItemText(IDC_EDIT1,info);rnrnrn出现错误,DEBUG ASSERTION FAILED, DEBUG程序消息能传到另一个视,info的值就是这个字符串,但在执行到m_edit.SetDlgItemText(IDC_EDIT1,info);这步就出错rnrnrn各位仁兄能帮忙改正一下吗?
debug assertion failed!!!! 急
大家好,我是一个学vc的新手,在做一个对话框后,编译运行都成功,然后在出来的点击菜单项本应该生成一个对话框,却出现了<em>debug</em> <em>assertion</em> <em>failed</em>。点确定后说试图执行系统不支持的操作。请大家帮帮我,谢谢
关于 Debug Assertion Failed!
关于 Debug Assertion Failed!rn我用VS2005编译一个程序,是关于调用Ultimate Toolbox界面库。编译的时候没有报出错。rn但是调试的时候就会弹出窗口说:rnDebug Assertion Failed!rnProgram:XX.exernFile:...\source\oxbitmapbutton.cpprnLine:341rnrnFor information on how your program can cause an <em>assertion</em> failure,see visual c++ documentation on asserts. rn(Please retry to <em>debug</em> application). rn===============================rnoxbitmapbutton.cpp中第341行代码为:VERIFY(m_imageList.Add(&grayBitmap, crMask) == m_nInactiveImageIndex);rn==============================rn点击“忽略”:又出现新的rnDebug Assertion Failed!rnProgram:XX.exernFile:...\source\oxbitmapbutton.cpprnLine:350rnrnFor information on how your program can cause an <em>assertion</em> failure,see visual c++ documentation on asserts. rn(Please retry to <em>debug</em> application). rn=================================rnoxbitmapbutton.cpp中第350行rn所属函数代码:rn//===============================rn if(BuildDisabledImage(hSourceIcon, bitmapSize, hDestIcon))rn rn // Add the disabled image to the image list and use thern // mask of the normal imagern VERIFY(m_imageList.Add(hDestIcon) == m_nDisabledImageIndex);//Line:350rn VERIFY(::DestroyIcon(hDestIcon));rn rn//================================rn点击“重试”:XX.exe已触发了一个断点,rn断点处代码:m_wndButton4.LoadBitmap(IDB_BITMAP_BUTTON4, TRUE, RGB(255, 0, 255));rnrn在头文件中声明成员变量:rnCOXBitmapButton m_wndButton1;rnrn在原文件中调用:rnBOOL CToolDlg::OnInitDialog()rnrn CDialog::OnInitDialog();rnrn m_wndButton1.LoadBitmap(IDB_BITMAP_BUTTON1, TRUE, RGB(255, 0, 255));rn m_wndButton1.SetToolTip(TRUE);rn m_wndButton1.SizeToContent();rn m_wndButton1.SetTrackLook(false);rnrn return TRUE; rnrnrn找不到解决方案。请问是何原因?谢谢!
Debug Assertion Failed! 问题
编译正确 一运行就调出一个对话框 rnDebug Assertion Failed! rn rn Program: H:\PROJECTS\TEST.EXE rn File:afx.inl rn Line:177rnFor information on how your program can cause an <em>assertion</em> failure,see the Visual C++ documentation on asserts. rn然后我按大部分人说的那样点重试 结果又跳出个对话框 rnwindows-没有软盘rn exception processing message c0000013 parameters 764ebf9c 4 764ebf9c 764ebf9crn 连续点三次鼠标这个对话框才会消失rn这是<em>怎么回事</em>啊 我没用软盘啊rn接着可能是打开那个afx.inl了rnAFX_INLINE TCHAR CString::operator[](int nIndex) constrnrn // same as GetAtrn ASSERT(nIndex >= 0);rn ASSERT(nIndex < GetData()->nDataLength); 这行即为177行!!rn return m_pchData[nIndex];rnrn各位高手帮忙给看看是<em>怎么回事</em>啊 小弟刚刚玩mfc 谢谢了~rnrn
VC++ Debug Assertion Failed!
编译链接均正常,运行时出现这个提示窗口:VC++ Debug Assertion Failed!(我写的是一个密码输入登陆界面,只要试图输入密码就这样)。请高手指点
Debug Assertion Failed 错误!
现做一工程,编译通过,调试出现Debug Assertion Failed 错误!rnrn基本判断是错误使用空指针,于是我进入单步跟踪,结果rnrn在InitInstance()函数的rnrnCMainFrame* pMainFrame = new CMainFrame;这一行过不去,继续追踪下去,在空体函数rnrnrnCMainFrame::CMainFrame()rn <----------------------------就是这一行rn<em>22</em>2 return ::GetObject(m_hObject, sizeof(BITMAP), pBitMap); rnrn这是不是在哪里装入位图资源的时候出错了?rnrnrn哪位高手给点提示,我该怎么办才能找到引起错误的地方?rnrn附加信息:rnrn1.这个工程使用了一个静态链接库(原工程是使用这个静态链接库对应的DLL,没有任何问题),我把DLL改成静态链接库后,出现了上述的错误,估计是在资源链接的哪个环节出象了问题,不知道动态链接库(DLL)和静态链接库在资源文件链接方面有什么差别.rnrn2.release版本能够运行,但一些位图没有显示rnrnrnrnrn
Debug Assertion Failed!帮帮忙!!!!!!!!
各位大哥帮帮忙,小弟今天在画图板上添加了绘图工具栏,程序如下:rnvoid CMainFrame::OnViewDrawbar() rnrn // TODO: Add your command handler code herern BOOL bVisible = ((m_DrawToolBar.GetStyle() & WS_VISIBLE) != 0);rn ShowControlBar(&m_DrawToolBar, !bVisible, FALSE);rn RecalcLayout();rnrnrnvoid CMainFrame::OnUpdateViewDrawbar(CCmdUI* pCmdUI) rnrn // TODO: Add your command update UI handler code herern BOOL bVisible = ((m_DrawToolBar.GetStyle() & WS_VISIBLE) != 0);rn pCmdUI->SetCheck(bVisible);rnrn不料出现Debug Assertion Failed!的错误,我单步执行是发现进入了死循环,但我不知道错在了什么地方?rn
DEBUG ASSERTION FAILED
// Initialize the port. This can be port 1 to 4.rn//rnBOOL CSerialPort::InitPort(CWnd* pPortOwner, // the owner (CWnd) of the port (receives message)rn UINT portnr, // portnumber (1..4)rn UINT baud, // baudratern char parity, // parity rn UINT databits, // databits rn UINT stopbits, // stopbits rn DWORD dwCommEvents, // EV_RXCHAR, EV_CTS etcrn UINT writebuffersize) // size to the writebufferrnrn assert(portnr > 0 && portnr < 5);rn assert(pPortOwner != NULL);程序运行到这会出现DEBUG ASSERTION FAILED ,不知道我应该查找哪个函数,我该添加点什么吗?rn
Debug Assertion Failed!求解!
各位好,我的代码在vc上运行时出了这个问题:rnDebug Assertion Failed!rnExpression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)rnrn我知道这么长的代码发到这边很不合适,但我也没办法了,找不到问题,只好请各位帮忙,谢过!rn#include "stdafx.h"rn#include rn#include rn#include rn#include rn#include rn#include rn#include rn#include rn#include rn#include rn#include rnusing namespace std;rn#define LENGTH(s) (sizeof(s)/sizeof(s[0]))rnrn// Item sold at an undiscounted pricern// derived classes will define various discount strategiesrnclass Item_base rnpublic:rn Item_base(const std::string &book = "",rn double sales_price = 0.0):rn isbn(book), price(sales_price) rn std::string book() const return isbn;rn // returns total sales price for a specified number of itemsrn // derived classes will override and apply different discount algorithmsrn virtual double net_price(std::size_t n) constrn return n * price; rn virtual ~Item_base() rn virtual Item_base* clone() constreturn new Item_base(*this);rnprivate:rn std::string isbn; // identifier for the itemrnprotected:rn double price; // normal, undiscounted pricern;rn// discount kicks in when a specified number of copies of same book are soldrn// the discount is expressed as a fraction used to reduce the normal pricernclass Bulk_item : public Item_base rnpublic:rn // redefines base version so as to implement bulk purchase discount policyrn double net_price(std::size_t) const;rn Bulk_item(const std::string& book,double sales_price,std::size_t qty=0,double disc_rate=0.0):rn Item_base(book,sales_price),min_qty(qty),discount(disc_rate)rn virtual Bulk_item* clone() constreturn new Bulk_item(*this);rnprivate:rn std::size_t min_qty; // minimum purchase for discount to applyrn double discount; // fractional discount to applyrn;rndouble Bulk_item::net_price(size_t cnt) constrnrn if (cnt >= min_qty)rn return cnt * (1 - discount) * price;rn elsern return cnt * price;rnrnrnrn// use counted handle class for the Item_base hierarchyrnclass Sales_item rnpublic:rn // default constructor: unbound handlern Sales_item(): p(0), use(new std::size_t(1)) rn // attaches a handle to a copy of the Item_base objectrn Sales_item(/*const*/ Item_base&);rn // copy control members to manage the use count and pointersrn Sales_item(const Sales_item &i):rn p(i.p), use(i.use) ++*use; rn ~Sales_item() decr_use(); rn Sales_item& operator=(const Sales_item&);rn // member access operatorsrn const Item_base *operator->() const rn rn if (p) return p;rn else throw std::logic_error("unbound Sales_item"); rn rn const Item_base &operator*() const rn rn if (p) return *p;rn else throw std::logic_error("unbound Sales_item"); rn rnprivate:rn Item_base *p; // pointer to shared itemrn std::size_t *use; // pointer to shared use countrn // called by both destructor and assignment operator to free pointersrn void decr_use()rn if (--*use == 0) delete p; delete use; rn;rnSales_item::Sales_item(/*const*/ Item_base& item):p(/*item.clone()*/&item),use(new std::size_t(1))rnrnrnrn// use-counted assignment operator; use is a pointer to a shared use countrnSales_item&rnSales_item::operator=(const Sales_item &rhs)rnrn ++*rhs.use;rn decr_use();rn p = rhs.p;rn use = rhs.use;rn return *this;rnrnrnin<em>line</em> boolrncompare(const Sales_item &lhs, const Sales_item &rhs)rnrn return lhs->book() < rhs->book();rnrnrnclass Basket rn // type of the comparison function used to order the multisetrn typedef bool (*Comp)(const Sales_item&, const Sales_item&);rnpublic:rn // make it easier to type the type of our setrn typedef std::multiset set_type;rn // typedefs modeled after corresponding container typesrn typedef set_type::size_type size_type;rn typedef set_type::const_iterator const_iter;rn Basket(): items(compare) // initialze the comparatorrn void add_item(const Sales_item &item)rn items.insert(item); rn size_type size(const Sales_item &i) constrn return items.count(i); rn double total() const; // sum of net prices for all items in the basketrnprivate:rn std::multiset items;rn;rndouble Basket::total() constrnrn double sum = 0.0; // holds the running totalrnrn /* find each set of items with the same isbn and calculatern * the net price for that quantity of itemsrn * iter refers to first copy of each book in the setrn * upper_bound refers to next element with a different isbnrn */rn for (const_iter iter = items.begin();rn iter != items.end(); iter =rn items.upper_bound(*iter))rn rn // we know there's at least one element with this key in the Basketrn // virtual call to net_price applies appropriate discounts, if anyrn sum += (*iter)->net_price(items.count(*iter));rn rn return sum;rnrnrnint main()rnrn Bulk_item bi("visual c++",58,3,0.5);rn Sales_item si(bi);rn Basket basket;rn basket.add_item(si);rn basket.add_item(si);rn basket.add_item(si);rn //basket.add_item(*(new Sales_item(*(new Item_base("think in java",32)))));rn cout<<
过程建模系统分析数据流图下载
系统分析可上的过程建模,有用例分析,数据流图 相关下载链接:[url=//download.csdn.net/download/llinyan/3225484?utm_source=bbsseo]//download.csdn.net/download/llinyan/3225484?utm_source=bbsseo[/url]
SP11880_11880C_维修手册下载
epson 大幅面打印机 SP11880_11880C_维修手册 相关下载链接:[url=//download.csdn.net/download/BOBwyx/3388904?utm_source=bbsseo]//download.csdn.net/download/BOBwyx/3388904?utm_source=bbsseo[/url]
hibernate_3.2官方开发包下载
hibernate官方开发包,你想要的都能找到,你懂的! 相关下载链接:[url=//download.csdn.net/download/wangfeiyang12345/5108064?utm_source=bbsseo]//download.csdn.net/download/wangfeiyang12345/5108064?utm_source=bbsseo[/url]
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件
我们是很有底线的