语句GetDlgItem(IDC_EDIT1)->EnableWindow(TRUE);为什么说Access Violation? [问题点数:0分]

Bbs1
本版专家分:40
结帖率 100%
Bbs7
本版专家分:10839
Bbs7
本版专家分:10839
Bbs6
本版专家分:9124
Bbs6
本版专家分:5582
Bbs7
本版专家分:15319
Bbs2
本版专家分:423
Bbs5
本版专家分:2635
((CButton*)GetDlgItem(IDOK))->EnableWindow(FALSE);//为什么没效果?
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
为什么我建立的多线程老是说我Access Violation
rn多线程的函数,但是每次都说我Access Violationrnrnrn static UINT ThreadFun1(LPVOID pParam) //线程函数rnrn UINT u=0;rn CRect rt(99,99,501,501);rn int index;rn CMultithreadsView* pView=(CMultithreadsView*)pParam;rn CDC* myDC=pView->GetDC();rn myDC->MoveTo(pView->point[0]);rn for(index=0;indexLineTo(pView->point[index]);rn Sleep(10);rn index++;rn rn int x=3;rn return u;rnrnrn这是线程函数,我调试了一下,发现错误是myDC->LineTo(pView->point[index]);。说我非法访问,但是我明明都建立了呀。有没有大神可以指导一下。
为什么总是说 Unhandled exception in ChatRoomClient.exe 0xC0000005 Access Violation
char *buff = new char[1000];rnmemset(buff,0,1000); rnint count;rncount = myServerSocket->Receive(buff,1000);rnbuff[count]=0;rnm_IDC_LIST_CHATBOX.AddString(buff);rnreturn <em>true</em>;rn运行的时候总是报错:rn0xC0000005 Access Violationrncount = myServerSocket->Receive(buff,1000);关键是这句。rn怎么解决啊?rn
为什么编译没有错,运行的时候说access violation?
#include rn#include rn#include rn#include rnusing namespace std;rnrntypedef structrnrn size_t length;rn int *p;rn int **s;rnMatrix_chain;rnrnvoid matrix_chain_order(Matrix_chain *p) rn rn int n=p->length-1;rn int **m;rn int l,j,k,q;rn m=new int*[n]; rn for(int i=1;is=new int*[n]; rn for(i=1;is[i]=new int[n];rn for(i=1;ip[i-1]*p->p[k]*p->p[j];rn if(qs[i][j]=k;rn rn rn rn rn for (i=1; i<>n;rn ma.length=n+1;rn matrix_chain_p(&ma);rn cout<<>ma.p[i];rn matrix_chain_order(&ma);rn print_optimal_parens(ma.s,1,ma.length-1);rn
Access Violation
#include rn#include rnchar* charc(char* p)rn rn char*p1=new char[strlen(p)+1];rn p1="";rn int i=0;rn while(i
access violation
T4 initbiao(T1 &a,T2 list,T3 count) rnT1 p=new node; rna->next=p; rnint i; rnfor(i=0;idata=list[i]; rnp->next=newone; rnp=newone; rn rn rnrnrnvoid print(T1 a) rnT1 p=new node; rnp=a->next; rnwhile(p) rncout<
Access violation
struct info;rninfo Startpoint;rnvector OPEN;rnOPEN.push_back(Startpoint);rn编译没有报错,但是调试的时候提示Access <em>violation</em>
:Access violation!
我想问一下,我的程序报下面这个错误:rnUnhandled exception in TestFuc.exe(Test.ocx):0x0000005:Access Violationrn是不是在Test.ocx中出的错呀!!rn改怎么解决呀!!rn高手请帮忙呀!!
Access violation???
COM客户端:rnhr = CoCreateInstance(CLSID_GPSProcess, NULL, CLSCTX_ALL,rn IID_IGPSProcess, (void **)&pIGPSProcess);rnpIGPSProcess->ConnectToServer(A2BSTR(ip));rnpIGPSProcess->ReceiveData();rnpIGPSProcess->SendCommand(A2BSTR(SIMID),A2BSTR(Command));rn单步跟踪时,第一句已经执行成功了,但是到了第二句就提示:“Unhandled exception ..0x000005:Access <em>violation</em>”<em>为什么</em>呢?
access violation~~~
大侠帮忙~~~rn执行时出现“0xc0000005:<em>access</em> <em>violation</em>”,请帮解决一下~~~谢谢rn#include "stdio.h"rn#include "malloc.h"rn#define maxium 32767rn#define maxver 9 /*defines the max number of vertexs which the programm can handle*/rn#define OK 1rnstruct Pointrnrn char vertex[3];rn struct Link *work;rn struct Point *next;rn;rnstruct Linkrnrn char vertex[3];rn int value;rn struct Link *next;rn;rnstruct Table /*the workbannch of the algorithm*/rnrn int cost;rn int Known;rn char vertex[3];rn char path[3];rn struct Table *next;rn;rnint Dijkstra(struct Point *,struct Table *);rnint PrintTable(int,struct Table *);rnint PrintPath(int,struct Table *,struct Table *);rnstruct Table * CreateTable(int,int);rnstruct Point * FindSmallest(struct Table *,struct Point *);/*Find the vertex which has the smallest value reside in the table*/rnint main()rnrn int i,j,num,temp,val;rn char c;rn struct Point *poinpre,*poinhead,*poin;rn struct Link *linpre,*linhead,*lin;rn struct Table *tabhead;rn poinpre=poinhead=poin=(struct Point *)malloc(sizeof(struct Point));rn poin->next=NULL;rn poin->work=NULL;rn restart:rn printf("Notice:if you wanna to input a vertex,you must use the format of number!\n");rn printf("Please input the number of points:\n");rn scanf("%d",&num);rn if(num>maxver||numvertex[0]='v';rn poin->vertex[1]='0'+i+1;rn poin->vertex[2]='\0';rn linpre=lin=poin->work;rn linpre->next=NULL;rn for(j=0;jnext=NULL;rn break;rn rn elsern rn lin=(struct Link *)malloc(sizeof(struct Link));rn linpre->next=lin;rn lin->vertex[0]='v';rn lin->vertex[1]='0'+temp;rn lin->vertex[2]='\0';rn printf("Please input the value betwixt %d th point towards %d th point:",i+1,temp);rn scanf("%d",&val);rn lin->value=val;rn linpre=linpre->next;rn lin->next=NULL;rn rn rn poinpre=poinpre->next;rn poin->next=NULL;rn rn printf("Please enter the vertex where Dijkstra algorithm starts:\n");rn scanf("%d",&temp);rn tabhead=CreateTable(temp,num);rn Dijkstra(poinhead,tabhead);rn PrintTable(temp,tabhead);rn return OK;rnrnstruct Table * CreateTable(int vertex,int total)rnrn struct Table *head,*pre,*p;rn int i;rn head=pre=p=(struct Table *)malloc(sizeof(struct Table));rn p->next=NULL;rn for(i=0;inext=p;rn if(i+1==vertex)rn rn p->vertex[0]='v';rn p->vertex[1]='0'+i+1;rn p->vertex[2]='\0';rn p->cost=0;rn p->Known=0;rn rn elsern rn p->vertex[0]='v';rn p->vertex[1]='0'+i+1;rn p->vertex[2]='\0';rn p->cost=maxium;rn p->Known=0;rn rn p->next=NULL;rn pre=pre->next;rn rn return head;rnrnint Dijkstra(struct Point *p1,struct Table *p2) /* Core of the programm*/rnrn int costs;rn char temp;rn struct Point *poinhead=p1,*now;rn struct Link *linna;rn struct Table *tabhead=p2,*searc,*result;rn while(1)rn rn now=FindSmallest(tabhead,poinhead);rn if(now==NULL)rn break;rn result=p2;rn result=result->next;rn while(result!=NULL)rn rn if(result->vertex[1]==now->vertex[1])rn break;rn elsern result=result->next;rn rn linna=now->work->next;rn while(linna!=NULL) /* update all the vertexs linked to the signed vertex*/rn rn temp=linna->vertex[1];rn searc=tabhead->next;rn while(searc!=NULL)rn rn if(searc->vertex[1]==temp)/*find the vertex linked to the signed vertex in the table and update*/rn rn if((result->cost+linna->value)cost)rn rn searc->cost=result->cost+linna->value;/*set the new value*/rn searc->path[0]='v';rn searc->path[1]=now->vertex[1];rn searc->path[2]='\0';rn rn break;rn rn elsern searc=searc->next;rn rn linna=linna->next;rn rn rn return 1;rnrnstruct Point * FindSmallest(struct Table *head,struct Point *poinhead)rnrn struct Point *result;rn struct Table *temp;rn int min=maxium,status=0;rn head=head->next;rn poinhead=poinhead->next;rn while(head!=NULL)rn rn if(!head->Known&&head->costcost;rn result=poinhead;rn temp=head;rn status=1;rn rn head=head->next;rn poinhead=poinhead->next;rn rn if(status)rn rn temp->Known=1;rn return result;rn rn elsern return NULL;rnrnint PrintTable(int start,struct Table *head)rnrn struct Table *begin=head;rn head=head->next;rn while(head!=NULL)rn rn if((head->vertex[1]-'0')!=start)rn PrintPath(start,head,begin);rn head=head->next;rn rn return OK;rnrnint PrintPath(int start,struct Table *head,struct Table *begin)rnrn struct Table *temp=begin->next,*p,*t;rn p=head;rn t=begin;rn if((p->vertex[1]-'0')!=start&&p!=NULL)rn rn while(temp->vertex[1]!=p->path[1]&&temp!=NULL)rn temp=temp->next;rn PrintPath(start,temp,t);rn printf("%s",p->vertex);rn rn elsern if(p!=NULL)rn printf("\n%s",p->vertex);rn return OK;rnrnrn
怎么用((CEdit *)GetDlgItem(IDC_EDIT1))->SetSel(0, -1);不能选中?
虽然实际上是选中了的,但在界面上却看不!与用“全选”命令或用鼠标或用键盘选中不一样!<em>为什么</em>呢?我用的是XP
GetDlgItem(IDC_EDIT1)->GetWindowText(char2,10);这句实现了什么样的功能?
如题所示,通过这个<em>语句</em>,程序进行了哪些操作,获得了哪些信息?新手求高手解答哦,分比较少请见谅,感激不尽!
为什么总是出现程序运行出错,access violation?
我认为程序没有什么问题呀,可是<em>为什么</em><em>为什么</em>总是出现程序运行出错,<em>access</em> <em>violation</em>?
为什么这段代码会报access violation的错?
CString profileName;rnchar *parser;rnchar buf[64];rn...rn...rnparser = strtok(buf," ");rnparser = strtok(NULL, " ");rnprofileName=parser;rnrn
为什么会出现Access Violation ...? 实在是迷惑
我用vc了一个 .dll,用vc调用已经成功了.rn我想用delphi调用该.dll文件.编译成功了rn就是在运行是出现 Access <em>violation</em> 也查了些网上的文章说是指针的问题rn或是类型不匹配.但我就是查不出毛病.请各位高手指点小弟一二.rnrnvc下定义的输出函数:rnint TimeDelay(unsigned long n)rnrndelphi 下的引用:rnvarrn Form1: TForm1;rn a : integer;rn n : Cardinal;rnrnimplementationrnrn$R *.dfmrnrnprocedure TForm1.Button1Click(Sender: TObject);rnbeginrn n:=13;rn a:=TimeDelay(n);//就是这步出问题rnrn
为什么我的程序出现access violation?help!!!!
-
为什么出现access violation at address 00000000
视频可以播放,是不是没有音频输出的问题?
急!!为什么会odbc32.dll violation access错误???
我将程序从Windows2000移植到WindowsXP运行rn在程序初始化时出现ODBC32.Dll <em>violation</em> <em>access</em>rn<em>为什么</em>?
为什么TStringList会抛出access violation 异常?
抛出<em>access</em> <em>violation</em> at addressrnrnrnprocedure TForm1.Button1Click(Sender: TObject);rnvarrn list: TStrings;rn mychar: Pchar;rnbeginrnlist := TStringList.Create;rnlist.Delimiter := '^';rnrn//这边进行任何对list,mychar的操作 怎么会导致下面抛出抛出<em>access</em> <em>violation</em> at address?rnrntryrnif (list<>nil) and (mychar<>nil) then list.DelimitedText := strPas(mychar);rnexceptrnon e : Exception dornbeginrnMessageBox(Handle, PChar('错误:' + e.Message), '错误信息', MB_ICONERROR);rnExit;rnend;rnend;rnend;
指针赋值为什么老出现Access violation?
以下是代码rnstruct MyPointrnrn float x,y,z;rn;rnrnstruct PNodernrn MyPoint p1,p2,p3,p4;rn float R,G,B;rn PNode *next;rn;rnclass MyList rnrnpublic:rn MyList();rn virtual ~MyList();rn void AddList(MyPoint p1,MyPoint p2,MyPoint p3,MyPoint p4,float R,float G,float B);rn PNode* GetNext();rn void ReSetCurrent();rnpublic:rn PNode *first;rn PNode *current;rn;rnvoid MyList::AddList(MyPoint p1,MyPoint p2,MyPoint p3,MyPoint p4,float R,float G,float B)rnrn PNode *p,*q;rn p=new PNode;rn [b]q=first;[/b]rn while(q->next!=NULL)rn q=q->next; rn p->p1=p1;rn p->p2=p2;rn p->p3=p3;rn p->p4=p4;rn p->R=R;rn p->G=G;rn p->B=B;rn p->next=NULL;rn q->next=p;rnrnrnrnrnrnrnrn在调用AddList的时候粗体字处老出现<em>access</em> <em>violation</em> 0xc0000005,<em>为什么</em>啊,求救!
看看我的代码,为什么会 Access Violation
asmrn MOV ECX,DWORD PTR L //长度rn XOR EBX,EBXrn CLCrn OK:rn RCR byte PTR TArrays[EBX],1rn INC EBXrn LOOP OKrn ;rnrn 实现对数组 TArrays 中数据除2
GotoDlgCtrl((CEdit*)GetDlgItem(IDC_EDIT1)); //设置焦点在第一个编辑框
[code=C/C++]GotoDlgCtrl((CEdit*)GetDlgItem(IDC_EDIT1)); //设置焦点在第一个编辑框[/code]rn求这句话的详细解释,谢谢了。
这个用法CEdit *edit1=(CEdit*)GetDlgItem(IDC_EDIT1)请教一下
请问 CEdit *edit1=(CEdit*)GetDlgItem(IDC_EDIT1) 这个<em>语句</em>中rnrn1、IDC_EDIT1 是什么是,资源ID还是其他?rn2、GetDlgItem(IDC_EDIT1)的作用是什么?rn3、GetDlgItem(IDC_EDIT1) 前<em>为什么</em> 还要加 (CEdit*) ?rnrn谢谢大家
有人说if(true==a) 比if(a==true) 好处多 为什么
有人说if(<em>true</em>==a) 比if(a==<em>true</em>) 好处多 <em>为什么</em>
EnableWindow()
在对话框资源中设置文本框为只读属性.rn在函数中p_Wnd->EnableWindow(TRUE),编译过后rn不好使.rn 反之,不设置文本框属性,p_Wnd->EnableWindow(FALSE)rn竟然好使,真搞不懂<em>为什么</em>?
菜鸟问题,GetDlgItem()->EnableWindow()编译时出错,大家帮帮忙,谢谢!
rnrn基于对话框的工程名为Server,<em>为什么</em>在ServerDlg.cpp中rn<em>语句</em>GetDlgItem(IDC_Receive)->EnableWindow(1);能通过编译,rnrn但在同一工程的MySocket.cpp中,rn<em>语句</em>GetDlgItem(IDC_Receive)->EnableWindow(1);编译时出错:rnrn'GetDlgItem' : function does not take 1 parametersrnrnleft of '->EnableWindow' must point to class/struct/unionrnrn其中IDC_Receive是对话框中一按钮的ID,rnrn这种错误一般是什么原因引起的?怎么改?我在MySocket.cpp中加了rn#include rn#include rn也不管用,大家帮帮忙?rn
((CWnd*)GetDlgItem(IDC_PRO))->ShowWindow(TRUE)中的ShowWindow(TRUE)什么意思啊?
ShowWindow中也没有<em>true</em>这个参数啊。
Help!!!!-Access violation
我在使用Delphi5用ODBC连接SQL Server,用Table时,出现'Access <em>violation</em> at address ..... in module 'IDODBC32.DLL',Read of address ....',Process stoped. 这个错误是在我将Access数据库转换为SQL Server后出现的。原来一切正常。大部分Table都出现这个错误,可能在Edit或Append或Close时出现。但也有几个不出这种错误,其实它们的代码都差不多。用Query连就没问题,但程序改动量太大了。rn我搞了几天都没搞定,焦头烂额的。rn紧急紧急,请高人相助。rn小弟感激不尽。
Access Violation问题!
今天做一个ODBC报表的开发,按照书上的代码敲了,但是运行的时候出现了如下问题:rn[img=https://img-bbs.csdn.net/upload/201605/14/1463209338_430967.png][/img]rn之后黄色的箭头指向这里rn[img=https://img-bbs.csdn.net/upload/201605/14/1463209515_435439.png][/img]rn网上查了一下说是指针区域位分配内存??可是小弟初学VC还不会调试。下面是程序段,各位大神帮忙看看,是哪个指针的问题?或者说是其他问题?rn在ODBCReportView.h中定义了两个指针:rn[code=c]#if !defined(AFX_ODBCREPORTVIEW_H__6BC2C6CB_3629_4F87_B987_4B616DBAF745__INCLUDED_)rn#define AFX_ODBCREPORTVIEW_H__6BC2C6CB_3629_4F87_B987_4B616DBAF745__INCLUDED_rnrn#if _MSC_VER > 1000rn#pragma oncern#endif // _MSC_VER > 1000rn#include "ODBCReportSet.h"rnrnrnclass CODBCReportView : public CScrollViewrnrnprotected: // create from serialization onlyrn CODBCReportView();rn DECLARE_DYNCREATE(CODBCReportView)rnrn// Attributesrnpublic:rn CODBCReportDoc* GetDocument();rn CODBCReportSet* m_pSet;rnrn在ODBCReportView.cpp中的OnInitialUpdate()函数输入如下代码:rnvoid CODBCReportView::OnInitialUpdate()rnrn CScrollView::OnInitialUpdate();rn //设置大小rn CSize sizeTotal(800,2000);rn //设置滚动窗口大小rn SetScrollSizes(MM_LOENGLISH,sizeTotal);rn CODBCReportDoc* pDoc=GetDocument();rn ASSERT_VALID(pDoc);rn //设置标题rn pDoc->SetTitle("ODBC pmtest Report");rn m_pSet=&pDoc->m_dbSet;rn //打开记录集rn m_pSet->Open();rn rnrnrnCODBCReportView类的OnDraw()函数如下,自己感觉问题像是出在这里??rnvoid CODBCReportView::OnDraw(CDC* pDC)rnrn CString line;rn TEXTMETRIC metrics;rn int y =0;rn CFont TitleFont;rn CFont HeadingFont;rn CFont DetailFont;rn int TabStops[]=100,275,650;rn rnrn //设置记录集为开始点rn m_pSet->Requery();rn //标题设为粗体rn TitleFont.CreateFont(44,0,0,0,FW_BOLD,FALSE,FALSE,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_ROMAN,"Times New Roman");rn //粗体加下划线rn HeadingFont.CreateFont(36,0,0,0,FW_BOLD,FALSE,TRUE,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_ROMAN,"Times New Roman");rn //一般字体rn DetailFont.CreateFont(18,0,0,0,FW_NORMAL,FALSE,TRUE,0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_ROMAN,"Times New Roman");rn //得到默认设置rn CFont*OldFont=pDC->SelectObject(&TitleFont);rn //检索标题字体测量rn pDC->GetTextMetrics(&metrics);rn //计算行高rn int LineHeight=metrics.tmHeight+metrics.tmExternalLeading;rn //设置行高为yrn y-=LineHeight;rn pDC->TextOut(200,0,"ODBC pmtest Report");rn //设置行头字体rn pDC->SelectObject(&HeadingFont);rn line.Format("%s","pmtest");rn //用tab输出rn pDC->TabbedTextOut(0,y,line,3,TabStops,0);rn if(m_pSet->IsBOF())rn rn return;rn rn LineHeight=metrics.tmHeight+metrics.tmExternalLeading;rn y-=LineHeight;//调整y的位置rn pDC->SelectObject(&DetailFont);rn pDC->GetTextMetrics(&metrics);rn LineHeight=metrics.tmHeight+metrics.tmExternalLeading;rn while(!m_pSet->IsEOF())rn line.Format("%s\t%s",rn m_pSet->m_Time,rn m_pSet->m_Value);rn //输出描述一行rn pDC->TabbedTextOut(0,y,line,3,TabStops,0);rn //得到下一行行高rn y-=LineHeight;rn m_pSet->MoveNext();rn rn //储存默认设置rn pDC->SelectObject(OldFont);rnrn[/code]有以前开发过类似ODBC报表的大手,望多多指教。最好能告诉我在哪里应该添加什么<em>语句</em>!!rn
出现access violation 问题!!
我是在做一个dcomconnection的应用!使用单独的datamodule!!在一个窗体中放置了几个按钮,通过他们切换不同的画面!但是只有开始设置的一个按钮的页面可以打开,其他的就算是空的也不能打开!!一按就会出现<em>access</em> <em>violation</em>提示!
Access Violation 错误
我写了一个循环来进行rc4加密计算,计算一部分就报如下错误:rnrnLoaded 'ntdll.dll', no matching symbolic information found.rnLoaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.rnFirst-chance exception in rc4Test.exe: 0xC0000005: Access Violation.rnrn是甚么原因呢
access violation问题
有没有什么软件或者方法可以捕获到软件发生的<em>access</em> <em>violation</em>错误是在调用那个函数或者在那个模块发生的吗?
shell32.dll access violation
编写一个mfc小程序,有时出现<em>access</em> <em>violation</em>而异常退出,debug后发现shell32.dll是引起的,各位大侠给指条明路吧
程序退出异常 Access Violation
程序在关闭时弹出[img=http://img.my.csdn.net/uploads/201211/21/1353483339_6831.jpg][/img]rn的错误提示,点击确定弹出rn[img=http://img.my.csdn.net/uploads/201211/21/1353483395_4411.jpg][/img]rn看了看,可能是程序结束的时候收尾工作没有做好,出现了访存冲突。rn程序中用到了 dbgrid、indy(ftp)、query组件。rn请求大牛们给点提示,小弟在此谢过。
关于Access violation writing
每次MFC程序退出的时候 都会出现 rnUnhandled exception at 0x035e1341 in cvPDM.exe: 0xC0000005: Access <em>violation</em> writing location 0x80517de0.rn请问这个问题应该从哪里入手解决 ?rn有没有一套通用的解决方法,和详细介绍该问题的相关资料。rn经常看见有人用分析内存的工具,大家能推荐一个主流工具么?rn谢谢大家
求助access violation错误
Dm_query.ADOQuery1.close;rnDm_query.ADOQuery1.open;rnd_year := Dm_query.ADOQuery1.Fieldbyname('nameid').AsString;rnd_month := Dm_query.ADOQuery1.Fieldbyname('name').AsString;rnrn运行到close就出现上面的错误了,小弟是新手,不知道哪里错了
一个访问冲突(Access Violation)
将如下代码:rnbool PLAYER_setFileEndMessage(int handle, HWND wnd,int msg)rnvoid CAsfPlayerTestDlg::OnFileendbutton() rnrn PLAYER_setFileEndMessage(playerId1,m_hWnd,WM_QUIT);rnrn转到Delphi:rnfunction PLAYER_setFileEndMessage(handle:Integer; wnd:HWND; msg:Integer): boolean;rnprocedure TasfPlayerFrm.btnEndMsgClick(Sender: TObject);rnbeginrn PLAYER_setFileEndMessage(playerId1, asfPlayerFrm.Handle, WM_QUIT); rnend;rn执行时出现异常:Access <em>violation</em> at address 00000000. Read of address 00000000.rn并且可知函数PLAYER_setFileEndMessage执行失败(该函数从dll中导出)。rn而原例执行时无异常。rnrn请指点迷津rn
Delphi 中 access violation
写一个MDI程序rn有一个功能是鼠标控制在子窗口中添加Timage控件rn并用TobjectList(是子窗口类 的变量)存储rn每次添加几个控件后 关闭窗口时rn就会提示Access <em>violation</em>错误 rn各位高手指教一下 会是 什么原因呢rn
syntax error or access violation
刚学PB,请大家看看什么问题rnstring is_name,is_pwd,pwd2,is_powerrnis_name=sle_1.textrnis_pwd=sle_2.textrnrnif is_name="" then rn messagebox("","请选择用户名!")rn sle_1.text=""rn sle_1.setfocus()rnelse rn if is_pwd="" then rn messagebox("","请输入密码!")rn sle_2.text=""rn sle_2.setfocus()rn elsern select pwd into :pwd2 from user where id=:is_name;rn rn if pwd2=is_pwd thenrn rn open(dw_main)rn close(parent)rn rnelsern messagebox("","密码错误!")rn sle_2.text=""rn sle_2.setfocus()rn end ifrnend ifrnend ifrnrnrnrn提示错误:syntax error or <em>access</em> <em>violation</em>:near 'user' from [user] where id=''
Access Violation!如何解决???
typedef struct _Data_Labelrnrn int uu;rn int num;rnDALABEL;rnrnDALABEL Label[19];rnrnint j=1;rnfor(; ((j (Label[j].uu))) ;j++) rn ;rnrndaStati.input1_chart) 是另一个结构体的成员之一。rn设置断点,运行到for一行时,报错-----rnUnhandled exception in Demo.exe(MFC42D.DLL):0xC00000005:Access Violation.rn试图将j强行赋值,但表达式Label[j].uu中的j中是随机数,不知道<em>为什么</em>!rn请高手指教!rn在线等。
access violation address 求解?
我用的c++ builder2009,调试这段代码时出现<em>access</em> <em>violation</em> at 0x005d6fc1:read of address 0x00000000,但是有时没有, rnrnvoid __fastcall TFDownload::HandleCallbackData(TWMCopyData& Message)rnrnrn CallbackLogType *log1 = (CallbackLogType *)Message.CopyDataStruct->lpData;rn IFWD_DL_status_enum status;rn String status_text; //有时出现上述错误rn int channel=0;rn TInst *inst=NULL;rn channel = log1->channel;rn status = log1->status;rn status_text = log1->text;rn if(NULL!=log1)rn rn delete log1; //有时出现上述错误rn log1=NULL;rn rn if(NULL!=(COPYDATASTRUCT *)Message.CopyDataStruct)rn rn delete (COPYDATASTRUCT *)Message.CopyDataStruct;rn (COPYDATASTRUCT *)Message.CopyDataStruct=NULL;rn rn //int noOfSNEdit;rn //int sum=0;rnrn inst = Instances[channel]; //有时出现上述错误rn if(inst)rn rn switch(status)rn rn case IFWD_DL_ProgressUpdated:rn SetStatus(inst, esProgress);rn inst->gauge->Progress = atoi(status_text.t_str());rn break;rn case IFWD_DL_ProcessOutlineUpdated: LogText(inst,status_text); break;rn case IFWD_DL_ProcessDetailUpdated: LogDetail(inst,status_text); break;rn case IFWD_DL_OK: StateEvent(e_OK , channel, status_text); break; // trigger state machine with call back resultrn case IFWD_DL_Error: StateEvent(e_Fail, channel, status_text);rn break; // trigger state machine with call back resultrn case IFWD_DL_AT_Command:rn if(ATCommandRxCallback)rn ATCommandRxCallback(inst, status_text);rn elsern LogText(inst,status_text); break;rn default:rn LogText(inst,"Unknown status from Download DLL: " + String(status));rn break;rn rn rnrnrn
ntdll.dll 0XC0000005:Access violation
DeviceHandle=(HANDLE)CreateFile(pDevicePath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);这个函数出错了rnrn调试如下rnOpenDeviceWithPath(void * & 0x00000000, void * & 0x00000000, unsigned int 8960, unsigned int 4136, unsigned short & 0, unsigned short & 0, const unsigned short * 0xcdcdcdcd) line 296rnIUSBDevice::OpenDeviceWithPath(const unsigned short * 0xcdcdcdcd) line 133 + 57 bytesrnrnrn各位大神,这个怎么改啊??rn
delphi access violation
主窗体 方法DeCodeMethod(IMSI:PChar; StartDate:PChar; LastDays:Integer):String;rn 其中调用C语言 dll中一个方法, 返回一个字符串 strrnrn在子窗体中 调用主窗体方法DeCodeMethod 得到返回的str , 采用ShowMessage(Str) 正确没问题!rn采用Self.Edit.Text:=Str; 就产生一个 <em>access</em> <em>violation</em> atox00452d25...错误 , 百思不得其解.....rn求原因 求办法....
c++builder Access Violation问题
在网上看到,用CPU窗口跳转到报错的的地址位置可以看到 错误信息:rn 例如:vcl40.@Stdctrls@TCustomEdit@SetAutoSize$qqr4boolrnrn可是 <em>为什么</em>我跳转到报错位置 只有汇编代码,找不到错误信息,具体是在哪能看到 类似“vcl40.@Stdctrls@TCustomEdit@SetAutoSize$qqr4bool”这样的信息?rnrn我用网上说的错误范例,也看不到这样的信息。
access violation 继续研究。
<em>access</em> <em>violation</em> 继续研究。rnrn我在学习delphi时,写了一个最简单的"hello world",只有一个标签和一个按钮,编译通过,运行时出现“<em>access</em> <em>violation</em> at address 844cabd8,read of ddress 844cabd8.",每次出现的地址不同,到了这里,非要用“ctrl,alt,del "关上delphi 才能退出。这是<em>为什么</em>?急请高手指点。rnrn新建application,在form1上贴一个 label, caption 为“莉,我心中永远的痛”,宋体16号字,再放一button, caption 为“退出”,“退出”button 代码:在最后的begin 和end 之间加了一句"close;" rn具体如下:(test.pas)rnunit test;rnrninterfacernrnusesrn Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,rn StdCtrls;rnrntypern TForm1 = class(TForm)rn Label1: TLabel;rn Button1: TButton;rn procedure Button1Click(Sender: TObject);rn privatern Private declarations rn publicrn Public declarations rn end;rnrnvarrn Form1: TForm1;rnrnimplementationrnrn$R *.DFMrnrnprocedure TForm1.Button1Click(Sender: TObject);rnbeginrnclose;rnend;rnrnend.rnrn之后,build project, 再运行,form 出现,一切如设想的,点击“退出”,form消失,但警告出现,有时还会有“exception <em>access</em><em>violation</em> in module vcl50.bpl at 84e86b08".rn难道delphi 比我还心痛。rn另外,我的显卡是s3savage 3d.听人说,有可能会不兼容。
Access violation at address 00000000
Access <em>violation</em> at address 00000000 rnRead of address 000000000 rn我是个菜鸟,玩游戏用外挂就会显示地图的时候出现这个,哪个好心的大哥帮忙一下。感激不尽。
0xC0000005:Access Violation
char* cQuantity = "Empty1"; rnchar* cStorage = "Empty2"; rn//m_pSet->m_Quantity是长整形的数据rnltoa(m_pSet->m_Quantity,cQuantity,10); rnltoa(m_pSet->m_Storage_Life,cStorage,10); rn后两句运行时出现rnUnhandled exception in ODBC1.EXE(MSVCRTD.DLL):0xC0000005:Access Violationrn的错误。rn请高手帮助找一下原因,谢谢!
access violation ,菜鸟求助
出错部分: 错误指在函数的开始括号处,debug开始的时候没有错,但是调用几次后就会出错rnint is_over2(char a , int i ,int j)rn int y = 0 ; rn switch(a) rn case 'a':rn while( copy_[i][j].air[y] != -1 )rn if(copy_[i][j].air[y] >= (P[i].s_time + start_time)%24 )rn return y;rn ++y;rn //找到最早的时间 < (P[i].s_time + start_time)%24 rn return -1 ;rn break;
Access Violation错误~~
#include rn#include rnrn#includern#includern#includernrn#pragma comment(lib,"libeay32.lib")rn#pragma comment(lib,"ssleay32.lib")rnrn#pragma comment( lib, "ws2_32.lib" ) rnrn#define CERTF "cert.pem" /*客户端的证书(需经CA签名)*/ rn#define KEYF "priv.key" /*客户端的私钥(建议加密存储)*/ rnrnrn#define CHK_NULL(x) if ((x)==NULL) exit (-1) rn#define CHK_ERR(err,s) if ((err)==-1) perror(s); exit(-2); rn#define CHK_SSL(err) if ((err)==-1) ERR_print_errors_fp(stderr); exit(-3); rnrn#define MY_PORT 6000rnrnint main() rn rn int err;rnrn //SOCKET listen_sd,sd;rn int listen_sd,sd;rn struct sockaddr_in sa_serv,sa_cli;rn //size_t client_len;rn int client_len;rn SSL_CTX* ctx;//ssl上下句柄rn SSL* ssl;//ssl结构体指针rn X509* client_cert;//x509结构体,用户保存客户端证书rn char* str;rn char buf[50];rn SSL_METHOD *meth;//ssl协议rnrn WSADATA wsaData;rn rn WSAStartup(MAKEWORD(1,1),&wsaData);rnrnrn meth = SSLv23_server_method();//ssl协议版本rn [color=#FF0000]ctx = SSL_CTX_new (meth);//新建ssl上下文句柄[/color]rnrn //设置服务器证书rn if(SSL_CTX_use_certificate_file(ctx,CERTF,SSL_FILETYPE_PEM) );rn exit(5);rn rn以上截取了基于openssl通信服务器端代码的一部分。rn运行到ctx = SSL_CTX_new (meth);//新建ssl上下文句柄这句出现acces <em>violation</em>错误,请问如何解决?
异常Access Violation
我在WIN98 下用Visuall C++ 6.0写程序,运行时老是出现Access Violation 异常,但是出异常的<em>语句</em>却看不出有什么不妥,请问有哪些原因会导致这个异常(除了使用未分配地址的指针以外)? rnrn rn
关于access violation
系统运行时,在进行多窗体间切换时,随机出现令人头痛的Access <em>violation</em> at address......也就是AV错误,请问怎样在程序屏蔽它,高分相送,谢谢!
Access Violation的问题
请看下面的程序:rn//反转字符串中的字符,即第一个变成最后一个,如此等等rn##includernrnvoid rev(char *s)rn for(char *e=s+strlen(s)-1;s
access violation at address
*.exe faulted with message:'<em>access</em> <em>violation</em> at 0x7c94abd5: write of address 0x00030d28' process stopped. use step or run to continue 运行程序时提示这个错误,查了好久都没有搞定,大侠们 帮帮看是什么原因,谢谢了rn我的邮箱是:zhang_kingrose@yahoo.com.cn
access violation error
有一段程序:如下 rnh:=CreateFile(pCHAR('C:\1.txt'),GENERIC_READ,0,Nil,OPEN_EXISTING,0,0);//打开文件rn if h<>INVALID_HANDLE_VALUE THENrn BEGINrn rn IF ReadFile(h,strs,120,w,NIL) THEN//读文件rn IF STRS<>NIL THENrn rn edit1.Text:=StrPas(strs);//报错 <em>access</em> <em>violation</em>rn用watch跟踪,ReadFile之后,strs没有内容,但w确实是读取的字节数。rnstrs 是Pchar,rn在线等待.rn
IHTMLDocument access violation
先贴代码rn[code=C/C++]rnhr = (*pfObjectFromLresult)( lRes, IID_IHTMLDocument, 0, (void**)&spDoc );rnif ( SUCCEEDED(hr) )rnrn// Change background color to redrnspDoc->put_bgColor( CComVariant("red") );//这里报acces <em>violation</em>rnrn[/code]rnrn这个是msdn的一个例子http://support.microsoft.com/kb/249232 rnrn请问这个是怎么回事?rnrn
an access violation raise的
在写程序的时候遇到了这样的报错
delphi access violation at address
我不知道这个是什么错误rn但是我运行是可以的rn我做的是进销存rn我第一次存进货单,可以保存的rn但是我第二次点菜单那边的进货单录入就会出现这个问题rn这个是这么回事
access violation at address 77f498d5
<em>为什么</em>当我访问一个ADOQuery时程序老报错:rn√<em>access</em> <em>violation</em> at address 77f498d5 .....rn该Query所在的form已经创建了的rn大家帮帮忙呀!
视图切换,显示Access violation
[code=c]rnvoid CMainFrame::SwitchViews(UINT nID)rnrn CView *m_pActiveView=GetActiveView();rnrnrn rn CView *pNewView;rn rn switch(nID)rn rn case IDD_SYSTEM:rn pNewView=(CView*) new CSystem;rn break;rn rn case IDD_TEST:rn pNewView=(CView*) new CTest;rn break;rn rn case IDD_CALIBRATION:rn pNewView=(CView*) new CCalibration;rn break;rn rn case IDD_QUALITYCONTROL:rn pNewView=(CView*) new CQualityControl;rn break;rn rn rn rn CCreateContext newContext;rn newContext.m_pNewViewClass = NULL;rn newContext.m_pNewDocTemplate = NULL;rn newContext.m_pLastView = NULL;rn newContext.m_pCurrentFrame = NULL;rn newContext.m_pCurrentDoc = GetActiveDocument();rn rn rn pNewView->Create(NULL,NULL,(AFX_WS_DEFAULT_VIEW & ~WS_VISIBLE),CFrameWnd::rectDefault,this,nID,&newContext);rn pNewView->OnInitialUpdate();rn SetActiveView(pNewView);rn pNewView->ShowWindow(SW_SHOW);rn rn SetWindowLong(pNewView->m_hWnd, GWL_ID,AFX_IDW_PANE_FIRST);rn RecalcLayout();rn rn m_pActiveView->DestroyWindow();rnrn[/code]rn调试create这句,显示Access <em>violation</em>rnhwnd显示0xcccccccrn怎么改呢?rn谢谢
access violation错误
我用VC写了一个程序,并且将其做成了一个DLL。之后用VC调用,是可以使用的。但是在用Delphi调用的时候,就出现了下面错误rn[color=#FF0000]图片无法上传[/color]rn描述一下就是<em>access</em> <em>violation</em> at address 0FXXXXX in module "xxx.dll"
access violation的问题
我的代码编译没有错误,rn但是运行到rnmultimap::iterator mit1=GetPosition(node_num);rn就出现<em>access</em> voilation,rn我的指针已经初始化了啊,<em>为什么</em>还出这种问题?
Access Violation问题
程序推出时出错:rn000437e9a指令引用的0x3379566内存不能为readrnexception in BSSSTest.exe: 0xC0000005: Access Violationrn调试时弹出rnPlease enter the path for SBHeap.crn可能是哪里出问题了呢rnrnrn
碰到access violation
#include rnrntypedef structrnrn int* array;rn int sp;rn int size;rnStackStruct;rnrnclass Queue rnpublic:rn void Init(StackStruct *s, int size);rn void cleanUp();rn int isEmpty(StackStruct *s);rn int isFull(StackStruct *s);rn void push(int item);rn int pop(StackStruct *s);rnrnpublic:rn StackStruct *s;rn;rnrnvoid Queue::Init(StackStruct *s, int size)rnrn s->array = new int[size];rn s->size = size;rn s->sp = 0;rnrnrnvoid Queue::cleanUp()rnrn delete s->array;rnrnrnint Queue::isEmpty(StackStruct *s)rnrn return s->sp == 0 ? 1 : 0;rnrnrnint Queue::isFull(StackStruct *s)rnrn return s->sp == s->size ? 1 : 0;rnrnrnvoid Queue::push(int item)rnrn if(!isFull(s)) s->array[s->sp++] = item;rnrnrnint Queue::pop(StackStruct *s)rnrn if(isEmpty(s))rn return 0;rn elsern return s->array[--s->sp];rnrnrnvoid main()rnrn Queue queue;rn StackStruct *stack =queue.s;rn queue.Init(stack, 15);rnrn for(int i=0; i < 25; i++)rn queue.push(i);rn while(!queue.isEmpty(stack))rn cout<array = new int[size];<em>语句</em>时出错,为<em>access</em> <em>violation</em>rn请高手指点.
0xC0000005: Access Violation 错误
[code=C/C++]//初始化客户端handleDatarn m_pHandleData = new PER_HANDLE_DATA;rn m_pHandleData->sendIO = NULL;rn m_pHandleData->recvIO = NULL;rn m_pHandleData->sock = m_connectSock;rn //接收结构rn if (m_pHandleData->recvIO == NULL)rn rn m_pHandleData->recvIO = new PER_IO_DATA;rn if (m_pHandleData->recvIO == NULL)rn rn delete m_pHandleData;rn return -1;rn rn memset(m_pHandleData->recvIO, 0, sizeof(PER_IO_DATA));rn m_pHandleData->recvIO->IoType = IoRecv;rn m_pHandleData->recvIO->pBuffer = new char[MAX_BUFFER_SIZE];rn rn rn //发送结构rn if (m_pHandleData->sendIO == NULL)rn rn m_pHandleData->sendIO = new PER_IO_DATA;rn if (m_pHandleData->sendIO == NULL)rn rn delete m_pHandleData->recvIO;rn delete m_pHandleData;rn return -1;rn rn memset(m_pHandleData->sendIO, 0, sizeof(PER_IO_DATA));rn m_pHandleData->sendIO->IoType = IoSend;rn m_pHandleData->sendIO->pBuffer = new char[MAX_BUFFER_SIZE];rn [/code]rn然后我把它清掉rn[code=C/C++] if (m_pHandleData != NULL)rn rn if (m_pHandleData->sock != INVALID_SOCKET)rn rn closesocket(m_pHandleData->sock);rn rn m_pHandleData->sock = INVALID_SOCKET;rn LPPER_IO_DATA tempIO = NULL;rn tempIO = m_pHandleData->recvIO;rn if (tempIO != NULL)rn rn if (tempIO->pBuffer != NULL)rn rn delete []tempIO->pBuffer;rn rn delete tempIO;rn rn tempIO = m_pHandleData->sendIO;rn if (tempIO != NULL)rn rn if (tempIO->pBuffer != NULL)rn rn delete []tempIO->pBuffer;rn rn delete tempIO;rn rn delete m_pHandleData;rn [/code]rn怎么就会出现这个错误 我跟踪到了 如果把map fileManageMap;屏蔽掉就可以 这是<em>为什么</em>呢?rn[code=C/C++]typedef struct _PER_IO_DATArnrn map fileManageMap; //int:文件IDrn OVERLAPPED overLapped;rn WSABUF wsDataBuf;rn char *pBuffer;rn IO_TYPE IoType;rnPER_IO_DATA, *LPPER_IO_DATA;[/code]
access violation 问题...
定义了一个类用来判断编号是否存在,但运行时出错:<em>access</em> <em>violation</em> at address ******** in module 'Project1.exe'.Read of address 00000004.rn出错的代码如下:rn function Tbasedata.CheckRec(Id:string):Boolean;rn beginrn Datamod.ADOINF.Close;rn Datamod.ADOINF.SQL.Clear;rn Datamod.ADOINF.SQL.Add(' select * from user_base where worker_id='''+Id+'''');rn Datamod.ADOINF.Open ;rn if Datamod.ADOINF.Eof then result:=falsern else result:=<em>true</em>;rn end;rnrnrn部分代码:rnconstructor Tbasedata.create ;rnbeginrnDatamod:=TDM.Create(nil);rnend;rnrndestructor Tbasedata.Destroy ;rnbeginrn freeandnil(Datamod);rn inherited;rnend;rnrn function Tbasedata.GetIdLists():TStrings;rn varrn id:string;rn idrec:TStrings;rn beginrn idrec:=TStringlist.Create ;rn Datamod.ADOINF.Close;rn Datamod.ADOINF.SQL.Clear;rn Datamod.ADOINF.SQL.Add('select * from user_base');rn Datamod.ADOINF.Open;rn while not Datamod.ADOINF.Eof dorn beginrn id:=Datamod.ADOINF.fieldbyname('worker_id').AsString;rn idrec.Add(Id);rn Datamod.ADOINF.Next;rn end;rn result:=idrec;rn end;rnrn function Tbasedata.CheckRec(Id:string):Boolean;rn beginrn Datamod.ADOINF.Close;rn Datamod.ADOINF.SQL.Clear;rn Datamod.ADOINF.SQL.Add(' select * from user_base where worker_id='''+Id+'''');rn Datamod.ADOINF.Open ;rn if Datamod.ADOINF.Eof then result:=falsern else result:=<em>true</em>;rn end;rnrn function Tbasedata.GetArcId(WorkId:string):string;rn beginrn Datamod.ADOINF.Close ;rn Datamod.ADOINF.SQL.Clear;rn Datamod.ADOINF.SQL.Add(' select * from user_base where worker_id='''+WorkId+'''');rn Datamod.ADOINF.Open ;rn result:=Datamod.ADOINF.fieldbyname('archives_id').AsString;rn end;
access violation异常
我在应用程序中创建了一个属性表单,但当我点击表单的“确定”或“取消”时整个应用程序就会退出,调试时提示出现异常,那么该怎么确定到底是哪条<em>语句</em>导致异常? rn 提示是“<em>access</em> <em>violation</em>”,非法访问
关于异常Access Violation
我在WIN98 下用Visuall C++ 6.0写程序,运行时老是出现Access Violation 异常,但是出异常的<em>语句</em>却看不出有什么不妥,请问有哪些原因会导致这个异常(除了使用未分配地址的指针以外)?
报错access violation ...
OpenDialog1.Execute 在XP系统上报错<em>access</em> <em>violation</em> at address 。。。rnrn而在2000上没事
"Access Violation"是什么问题?
#includern#includernusing namespace std;rnrnstruct objectrnrn char *name; rn;rnrnmain()rnrn object* ptr=new object;rn strcpy(ptr->name,"Name");rn delete [] ptr->name;rn delete ptr;rn system("pause");rn
关于access violation异常
程序我这边测试过很多次没有问题,但是到了客户那里,却会报异常:rn<em>access</em> <em>violation</em> at address 00000000. Write of address 00000000.rnrn客户那边的系统是2008的,我自己用的是Win7,我想问一下这个是代码问题还是系统问题?如果是代码问题怎么找原因?
"Access Violation"求解决
[code=C/C++]int DeleteNodeList(LIST *l, int i) // 删除链表第i个元素rnrn int k = 0;rn NODE *p = NULL;rn if(l == NULL || i < 1 || i > l->length)rn return NULL;rn p = l->head->next;rn if(p == NULL) return NULL;rn while(k < l->length)rn rn k++;rn if(k == i)rn break;rn p = p->next;rn rn p->next->pior = p->pior;rn p->pior->next = p->next;rn free(p->date);rn free(p);rn l->length--;rn return 1;rn[/code]rnrn这段程序是删除链表里第i个元素,链表LIST和节点NODE的结构为[code=C/C++]typedef struct _nodernrn void * date;rn struct _node * pior;rn struct _node * next;rnNODE;rnrntypedef struct rnrn NODE * head;rn NODE * last;rn int length;rnLIST;[/code]rnrn编译没有问题,但是我在调试的时候弹出“Access Violation”求高手帮忙给看下,谢谢!
程序调试提示“Access Violation”
我用VC写了个在实验数据中寻找需要的数值,每个实验文件中有2034个数据,其中波长和强度值一一对应。主要代码如下: rnrnvoid CFindPeakDlg::OnBegin() rn rn // TODO: Add your control notification handler code here rnrn CFileDialog openPre(<em>true</em>,"*.ROH",NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_ALLOWMULTISELECT, rn "待处理文件(*.ROH)|*.ROH|所有文件(*.*)|*.*||"); rn DWORD MAXFILE = 256000; //设置缓冲区, rn openPre.m_ofn.nMaxFile = MAXFILE; rn char* pc = new char[MAXFILE]; rn openPre.m_ofn.lpstrFile = pc; rn openPre.m_ofn.lpstrFile[0]=NULL; rnrn int index1=0,x=0;//文件数量统计 rnrn if(openPre.DoModal()==IDOK) rn rn //启动EXCEL服务器,设置初始属性 rn _Application app; rn Workbooks books; rn _Workbook book; rn Sheets sheets; rn _Worksheet sheet; rn Range range; rn LPDISPATCH lpDisp; rn COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR); rnrn //Create Excel server (start Excel) rn if(!app.CreateDispatch("Excel.Application")) rn rn AfxMessageBox("Can't start Excel server! "); rn return; rn rn app.SetVisible(TRUE); //set Excel visible rn app.SetUserControl(TRUE); //user can operate Excel rnrn books=app.GetWorkbooks(); rn book=books.Add(covOptional); rn sheets=book.GetSheets(); rn sheet=sheets.GetItem(COleVariant((short)1)); rn range.AttachDispatch(sheet.GetCells(),TRUE); rnrn POSITION posi= openPre.GetStartPosition(); rn CString sPath=""; rnrn m_Wavelength2=290.566;//定义需要寻找的数值的波长和通道; rn m_Slaver2=2; rnrn while (posi!= NULL) rn rn sPath=openPre.GetNextPathName(posi);//每次循环都得到下一个文件路径 rn FILE *fd=fopen(sPath,"rb"); rn float buf[2056]; rn fread(buf,sizeof(buf[0]),2056,fd);//读取二进制文件,放到buf数组中 rnrn float xbuf[2034]; rn float ybuf[2034]; rn for (int j=0;j 288&&xbuf[1] < 0.001) //波长与给定的相等; rn rn x=++index1;//统计寻找文件数量; rn range.SetItem(_variant_t((long)(x)),_variant_t((long)1),_variant_t(ybuf[k])); rn break;//把数值输出到EXCEL,并且跳出FOR循环,寻找下一个文件; rn rn rn rn rn rn rn rn程序运行后,当寻找到64个文件时,程序就会出错。调试的时候,就会出现“Access Violation”.rn在"Disassembly"窗口,光标停在这一行:7C92100B 83 7A 14 00 cmp dword ptr [edx+14h],0rn
Access violation 错误
在线程中调用一个函数处理数据,处理相同的数据时,超过三遍以后,就会出现Access <em>violation</em> 错误,用的是Win7 32bit ,Delphi2010,函数如下:rnfunction TFmain.ProcessInChlStatus(Datas: TBytes;rn DataLen: integer): TChlStatusArray;rnvarrn i, j, index: integer;rn chl, s: byte;rn temp: AnsiString;rn binStr, str: AnsiString;rn dimArray: TChlStatusArray;//TChlStatusArray 为自定义类型rnbeginrn for i := 0 to MaxInChlCount - 1 do / / MaxInChlCount 为常量 rn beginrn dimArray[i].ChlCode := i + 12;rn dimArray[i].Status := -1;rn end;rn index := 0;rn tryrn for i := 2 to DataLen - 2 dorn beginrn chl := Datas[i];rn binStr := copy(inttoBin(Datas[i]), 25, 8);rn case index ofrn 0:rn beginrn for j := 3 to 8 dorn beginrn // s := strtoint(copy(binStr, j, 1));rn temp := binStr[j];rn s := strtoint(temp);rn dimArray[index * 6 + (j - 3)].ChlCode := j + 9; rn dimArray[index * 6 + (j - 3)].Status := s;rn end;rn end;rn 1:rn beginrn for j := 3 to 8 dorn beginrn temp := binStr[j];rn s := strtoint(temp);rn dimArray[index * 6 + (j - 3)].ChlCode := j + 15;rn dimArray[index * 6 + (j - 3)].Status := s;rn end;rn end;rn 2:rn beginrn for j := 3 to 8 dorn beginrn // s := strtoint(copy(binStr, j, 1));rn temp := binStr[j];rn s := strtoint(temp);rn dimArray[index * 6 + (j - 3)].ChlCode := j + 21;rn dimArray[index * 6 + (j - 3)].Status := s;rn end;rn end;rn 3:rn beginrn for j := 3 to 8 dorn beginrn // s := strtoint(copy(binStr, j, 1));rn temp := binStr[j];rn s := strtoint(temp);rn dimArray[index * 6 + (j - 3)].ChlCode := j + 27;rn dimArray[index * 6 + (j - 3)].Status := s;rn end;rn end;rn 4:rn beginrn for j := 3 to 8 dorn beginrn // s := strtoint(copy(binStr, j, 1));rn temp := binStr[j];rn s := strtoint(temp);rn dimArray[index * 6 + (j - 3)].ChlCode := j + 33;rn dimArray[index * 6 + (j - 3)].Status := s;rn end;rn end;rn 5:rn beginrn for j := 3 to 8 dorn beginrn // s := strtoint(copy(binStr, j, 1));rn temp := binStr[j];rn s := strtoint(temp);rn dimArray[index * 6 + (j - 3)].ChlCode := j + 39;rn dimArray[index * 6 + (j - 3)].Status := s;rn end;rn end;rn 6:rn beginrn for j := 3 to 8 dorn beginrn // s := strtoint(copy(binStr, j, 1));rn temp := binStr[j];rn s := strtoint(temp);rn dimArray[index * 6 + (j - 3)].ChlCode := j + 45;rn dimArray[index * 6 + (j - 3)].Status := s;rn end;rn end;rn 7:rn beginrn for j := 3 to 8 dorn beginrn // s := strtoint(copy(binStr, j, 1));rn temp := binStr[j];rn s := strtoint(temp);rn dimArray[index * 6 + (j - 3)].ChlCode := j + 51;rn dimArray[index * 6 + (j - 3)].Status := s;rn end;rn end;rn end;rn index := index + 1;rn end;rn exceptrnrn end;rn result := dimArray;rnend;rnrnrn说明:已经在win7的数据保护中做了处理。rn
程序出现Access Violation!
void CBufferOut::InsertBuffer(char* m_pInSort,int iLen) //1rn //2rn struct PacketSort* m_pGetSort; //3 rn m_pGetSort = (struct PacketSort *)m_pInSort; //4rn...rnrn调试到第四行,出现Unhandle Exception in cOut.exe(WDMAUD.DRV)0xC0000005: Access Violation错误!rnrn还有奇怪的现象,如果我直接从调用方法的地方单步跟踪进来,这个地方是能调试过去的!rnrn传进来的Buffer我是用G723压缩过的一块数据,如果不压缩也没问题!难道内存被锁定了吗?rnrnrn
Access violation DLL操作
一个读 磁卡的上位机rnrnrn[code=C/C++]rn__int16 hex_asc(unsigned char *hex, unsigned char *asc, unsigned long length)rnrn/*说明:将十六进制数据转换为ASCII码rn参数:rnhex: 输入要转换的字符串rnasc: 存放转换后的字符串 rnlength: 为要转换的字符串长度rnrn返回:=0 正确rn<>0 错误rn=0 正确rn*/rnrn[/code]rnrn[code=Delphi(Pascal)]rnrnfunction rsc_4442(icdev: longint;length:smallint; password:PAnsiChar):smallint;stdcall;rn external 'MWIC_32.dll' name 'rsc_4442';rnrnfunction hex_asc(hex:PAnsiChar;asc:PAnsiChar;len:smallint):smallint;stdcall;rn external 'MWIC_32.dll' name 'hex_asc';rnrnprocedure TForm2.Button5Click(Sender: TObject);rnvarrn psw_hex: array[0..2] of AnsiChar;rn psw_hexstr: array[0..5] of AnsiChar;rn ret: Integer;rnbeginrn ret := rsc_4442(icdev, 3, psw_hex);rn if ret = 0 thenrn beginrnrn ret := hex_asc(psw_hex, psw_hexstr, 6);rn if ret = 0 thenrn ListBox.Items.Add(psw_hexstr) 运行到这里就出现了 Access <em>violation</em> at 00550CF3 in module 'project1.exe'. Read of address 8B33B997 如果把这句话 改成 showmessage(psw_hexstr) 可以正确显示,没错误rn end;rnend;[/code]
单片机板实验指导书,对单片机入门有帮助下载
单片机板实验指导书,对单片机学习有很大的帮助,大家可以看看 相关下载链接:[url=//download.csdn.net/download/zjl19890928/2195359?utm_source=bbsseo]//download.csdn.net/download/zjl19890928/2195359?utm_source=bbsseo[/url]
RADStudioXE2 注册机下载
注册机 最新的 支持 update1 最新版本 相关下载链接:[url=//download.csdn.net/download/z.shine/3923655?utm_source=bbsseo]//download.csdn.net/download/z.shine/3923655?utm_source=bbsseo[/url]
78K0Dx2 UM Chinese下载
78K0Dx2单片机的中文手册,详细介绍了78K0Dx2单片机的各模块的特性及使用方法,包括调试工具的设置等等 相关下载链接:[url=//download.csdn.net/download/tyut_zhangjie/4592116?utm_source=bbsseo]//download.csdn.net/download/tyut_zhangjie/4592116?utm_source=bbsseo[/url]
我们是很有底线的