山寨:不是最好的,是最适合我们的!欢迎体验山寨 中文版MSDN

Blog @ Blog

当华美的叶片落尽,生命的脉络才历历可见。 -- 聂鲁达

常用链接

统计

积分与排名

BBS

Blog

Web

最新评论

Unhandled exception in EastR.exe (MFC42D.DLL) :0xC0000005;Access Violation

1、编译没有错误。
--------------------Configuration: EastR - Win32 Debug--------------------

EastR.exe - 0 error(s), 0 warning(s)

2、运行到某一个函数报错

3、调试到int m_ClockNo = atoi(NewNo->GetItemText(0,0).GetBuffer(NewNo->GetItemText(0,0).GetLength()));
报Unhandled exception in EastR.exe (MFC42D.DLL) :0xC0000005;Access Violation错误

附错误函数代码:
void CChangeClockNo::OnOK()
{
 // TODO: Add extra validation here
 
 UpdateData(true);
 int New_id = atoi(m_strNewID.GetBuffer(m_strNewID.GetLength ()));
 int m_ClockNo = atoi(NewNo->GetItemText(0,0).GetBuffer(NewNo->GetItemText(0,0).GetLength()));
 int m_Rate = atoi(NewNo->GetItemText(0,2).GetBuffer(NewNo->GetItemText(0,2).GetLength ()));
 int Com = 1;
 int nItem = 0;
 

 HANDLE hPort;

 hPort = OpenCommPort(Com,m_Rate);
 if(!hPort)
 {
  AfxMessageBox("端口被占用!");
 }
 else
 { 
  int Model;
  double Ver;
  int cls;
  GetClockModel(hPort,Model,Ver,cls);
  if(Ver==880 || Ver==889 || Ver==900)
  {
   SetCmdVerify(true);
  }
  if(!CallClock(hPort,m_ClockNo))
  {
   AfxMessageBox("联机失败!");
  }
  else
  {    
   if(SetClockID(hPort,New_id))
   {
    AfxMessageBox("新机号设置成功!");
   }
   else
    AfxMessageBox("修改机号失败!");
   
  }
  ClosePortHandle(hPort);
  UnCallClock(hPort);
 }
 
}


posted on 2007-08-29 17:09 isabc 阅读(8897) 评论(4)  编辑 收藏 引用 所属分类: BUG分析

评论

# re: Unhandled exception in EastR.exe (MFC42D.DLL) :0xC0000005;Access Violation 2008-06-13 19:24 胡牛

完全一样的错误,出在下面:
char **hcd;
hcd[i]=new char[n];//错误 Unhandled exception in EastR.exe 0xC0000005;Access Violation  回复  更多评论   

# re: Unhandled exception in EastR.exe (MFC42D.DLL) :0xC0000005;Access Violation 2008-06-13 19:26 胡牛

完全一样的错误,出在下面:
char **hcd;
hcd[i]=new char[n];//错误 Unhandled exception in EastR.exe 0xC0000005;Access Violation  回复  更多评论   

# re: Unhandled exception in EastR.exe (MFC42D.DLL) :0xC0000005;Access Violation 2008-11-12 12:43 userpp

那到底怎么解决的呢,你们也不说一下@胡牛
  回复  更多评论   

# re: Unhandled exception in EastR.exe (MFC42D.DLL) :0xC0000005;Access Violation 2009-02-24 11:29 ajie

应该是没有找到实际的控件,我在一个主窗口调用一个子窗口的控件,出现同样的问题,在子窗口自己调用就没有问题  回复  更多评论   


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


广告信息(免费广告联系)

中文版MSDN:
欢迎体验