Unhandled exception

confidence2010 2011-01-15 09:42:59
运行用vs2005的c++写的一个程序,弹出错误Unhandled exception at 0x10227bd0 (msvcr80d.dll) in NMS.exe: 0xC0000005: Access violation reading location 0x0000000a.什么意思?怎么改啊?里面用到了一个线程。而且程序开始运行一天就崩溃了。内存泄露都有哪些方面的原因啊?
...全文
269 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ouyh12345 2011-01-15
  • 打赏
  • 举报
回复
运行了一天才崩溃,应该是越界了吧
崩溃后调试,查看调用堆栈
Eleven 2011-01-15
  • 打赏
  • 举报
回复
Debug打开call stack,看看函数调用堆栈
confidence2010 2011-01-15
  • 打赏
  • 举报
回复
CTime CurrentTime=CTime::GetCurrentTime();
CString strTime1 = CurrentTime.Format("%Y-%m-%d %H:%M:%S");
这样用是不是就对了?[Quote=引用 5 楼 zhanshen2891 的回复:]
是d

回复内容太短了!
[/Quote]
zhanshen2891 2011-01-15
  • 打赏
  • 举报
回复
是d

回复内容太短了!



confidence2010 2011-01-15
  • 打赏
  • 举报
回复
哦。ThreadFuncPing(void * lpParam=0x0012fc70) Line 238 是strTime1.Format("%Y-%m-%d %H:%M:%S");是不是format()用的有问题?我用的CTime的format()[Quote=引用 1 楼 visualeleven 的回复:]
Debug打开call stack,看看函数调用堆栈
[/Quote]
confidence2010 2011-01-15
  • 打赏
  • 举报
回复
msvcr80d.dll!_output_l(_iobuf * stream=0x0790f778, const char * format=0x00453fd1, localeinfo_struct * plocinfo=0x00000000, char * argptr=0x0790f810) Line 1638 + 0x1f bytes C++
msvcr80d.dll!_vscprintf_helper(int (_iobuf *, const char *, localeinfo_struct *, char *)* outfn=0x10227240, const char * format=0x00453fc0, localeinfo_struct * plocinfo=0x00000000, char * ap=0x0790f808) Line 405 + 0x13 bytes C
msvcr80d.dll!_vscprintf(const char * format=0x00453fc0, char * ap=0x0790f808) Line 414 + 0x14 bytes C
mfc80d.dll!ATL::ChTraitsCRT<char>::GetFormattedLength(const char * pszFormat=0x00453fc0, char * args=0x0790f808) Line 473 + 0xe bytes C++
mfc80d.dll!ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > >::FormatV(const char * pszFormat=0x00453fc0, char * args=0x0790f808) Line 2142 + 0xd bytes C++
mfc80d.dll!ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > >::Format(const char * pszFormat=0x00453fc0, ...) Line 2538 C++
NMS.exe!ThreadFuncPing(void * lpParam=0x0012fc70) Line 238 + 0x12 bytes C++
mfc80d.dll!_AfxThreadEntry(void * pParam=0x0012e718) Line 109 + 0xf bytes C++
msvcr80d.dll!_callthreadstartex() Line 348 + 0xf bytes C
msvcr80d.dll!_threadstartex(void * ptd=0x00ccae78) Line 331 C
call stack 里的信息是这样的。看不懂什么意思。请您指点。[Quote=引用 1 楼 visualeleven 的回复:]
Debug打开call stack,看看函数调用堆栈
[/Quote]

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧