|
코드들을 FormCreate Event 가 아닌 다른 이벤트 에 넣어 보세요.
dtacq 님이 쓰신 글 :
: 컴파일할때는 에러가 안나는데 실행하면 'Access violation at address~~~'라는 메세지가 나옵니다.
: 아래부분을 전부 주석처리하면 에러가 안나는데.. 어떤 부분이 잘못되었는지 도움 부탁드립니다.
:
:
: void __fastcall TfrmMtg::FormCreate(TObject *Sender)
: {
: TSearchRec sr;
: int i = 1;
: int iAttributes = 0;
: String sTempName;
: iAttributes|=faReadOnly|faHidden|faSysFile|faVolumeID|faArchive|faAnyFile;
:
: // make Button array for Montage kinds
: buttons->Add(BtnMtg);
: BtnMtg->Width = ScrollBox1->Width - GetSystemMetrics(SM_CXVSCROLL) -4;
:
: // find *.mon files and add them to montage list
: sTempName = "C:\\Temp\\*.mon";
: if (FindFirst(sTempName, iAttributes, sr) == 0) {
: do {
: i++;
: sTempName = sr.Name;
: sTempName.SetLength(sTempName.Length() -4);
: if (sTempName == "32R") {
: i--;
: continue;
:
: }
: AddButton(sTempName); // 몽타지 버튼 추가
: AddMontageList(sTempName, i); // 리뷰 몽타지 설정에 몽타지 리스트 로드
:
: } while (FindNext(sr) == 0);
: }
: //add code
: FindClose(sr);
:
: // make Label array of Electode for Montage remake
: electrodes->Add(LbElectrode);
: static const String name_electrd[] = {"HEOG", "FP1", "FP2","F7",
: "F3", "Fz", "F4", "F8","ftc1",
: "ftc2", "T3", "C3", "Cz","C4",
: "T4", "tt1", "tcp1","Cp1", "Cp2",
: "tcp2", "tt2", "T5", "P3", "Pz",
: "P4", "T6", "Po1", "Po2", "O1",
: "Oz", "O2", "A1", "A2", ""};
: static const POINT pt_electrd[] = {{524,33},{430,64},{503,64},{371,97},
: {419,105}, {467,105},{515,105},{563,97},{395,137},
: {539,137},{347,177},{411,177},{467,177},{523,177},
: {585,177},{342,218},{398,218},{443,218},{491,218},
: {539,218},{592,218},{355,258},{411,258},{467,258},
: {523,258},{579,258},{418,288},{515,288},{419,321},
: {467,321},{515,321},{299,185},{630,185},{0,0}};
: for (int i = 0; name_electrd[i].Length() != 0; ++i) {
: AddLabel(name_electrd[i], pt_electrd[i].x, pt_electrd[i].y);
: }
: fStatisticFileChange=false;
: FileListBox1->Directory= StatisticsPathDirectory;
: FileListBox2->Directory= StatisticsPathDirectory;
: FileListBox3->Directory= StatisticsPathDirectory;
: FileListBox4->Directory= StatisticsPathDirectory;
: FileListBox5->Directory= StatisticsPathDirectory;
: FileListBox6->Directory= StatisticsPathDirectory;
: FileListBox1->FileName= StatisticsPathDirectory+StatisticEEGNMFileName;
: FileListBox2->FileName= StatisticsPathDirectory+StatisticEEGSDFileName;
: FileListBox3->FileName= StatisticsPathDirectory+StatisticVEPNMFileName;
: FileListBox4->FileName= StatisticsPathDirectory+StatisticVEPSDFileName;
: FileListBox5->FileName= StatisticsPathDirectory+StatisticAEPNMFileName;
: FileListBox6->FileName= StatisticsPathDirectory+StatisticAEPSDFileName;
:
:
: // 리뷰몽타지 설정 부분
: // -- 기존몽타지 그리드 타이틀바 설정
: GridMontage->Cells[0][0] = "번호";
: GridMontage->Cells[1][0] = "몽타지 이름";
: GridMontage->Cells[0][1] = "1";
: GridMontage->Cells[1][1] = "32R";
:
: // -- 리뷰몽타지 그리드 타이틀바 설정
: GridReviewM->Cells[0][0] = "번호";
: GridReviewM->Cells[1][0] = "몽타지 이름";
: GridReviewM->Cells[0][1] = "1";
: GridReviewM->Cells[1][1] = "32R";
: LoadRMontageList(); // 리뷰 몽타지를 몽타지 환경파일에서 읽어 로드
:
:
: }
|