C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[70508] Re:Access violation 에러해결좀 부탁드립니다.
김태선 [cppbuilder] 3018 읽음    2013-12-12 22:00
String *sMacAddr = new String[DBrow];

이런식으로 변수 선언을 모두 바꾸시고

사용후 delete[] sMacAddr; 해주면 됩니다.


히리 님이 쓰신 글 :
: void __fastcall TSUIM::schBTClick(TObject *Sender)
: {
:     Text_save();
:     int i = 0;
:     int schcount = 0;
:
:     String *sMacAddr;
:     String *sNo;
:     String *ssdm_ver;
:     String *sLanguage;
:     String *sOS_ver;
:     String *sPartitionType;
:     String *sDiskModel;
:     String *sNumOfPartition;
:     String *sdiskSize;
:     String *sIsSRS;
:     String *scurrentTime;
:
:     for(i = 0; i<DBrow;i++)
:     {
:         if(ListView1->Items->Item[i]->SubItems->Strings[3].Pos(schOS_ver))
:         {
:             sNo[schcount]             = ListView1->Items->Item[i]->Caption;
:             sMacAddr[schcount]        = ListView1->Items->Item[i]->SubItems->Strings[0];
:             ssdm_ver[schcount]      = ListView1->Items->Item[i]->SubItems->Strings[sdm_ver];
:             sLanguage[schcount]     = ListView1->Items->Item[i]->SubItems->Strings[Language];
:             sOS_ver[schcount]         = ListView1->Items->Item[i]->SubItems->Strings[OS_ver];
:             sPartitionType[schcount] = ListView1->Items->Item[i]->SubItems->Strings[PartitionType];
:             sDiskModel[schcount]    = ListView1->Items->Item[i]->SubItems->Strings[DiskModel];
:             sNumOfPartition[schcount]= ListView1->Items->Item[i]->SubItems->Strings[NumOfPartition];
:             sdiskSize[schcount]        = ListView1->Items->Item[i]->SubItems->Strings[diskSize];
:             sIsSRS[schcount]        = ListView1->Items->Item[i]->SubItems->Strings[IsSRS];
:             scurrentTime[schcount]    = ListView1->Items->Item[i]->SubItems->Strings[currentTime];
:             schcount++;
:         }
:         ListView1->Items->Clear();
:     }
: }
:
: 버튼을 누르면 Access violation at address 004036BA in module 'Project1.exe' Read of address~~ 에러가 뜹니다. 이유가 뭘까요?

+ -

관련 글 리스트
70507 Access violation 에러해결좀 부탁드립니다. 히리 3300 2013/12/12
70508     Re:Access violation 에러해결좀 부탁드립니다. 김태선 3018 2013/12/12
70510         Re:Re:Access violation 에러해결좀 부탁드립니다. 히리 2829 2013/12/12
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.