|
에거.. 도대체 뭐가 잘못 된지 모르겠군요.. 이거 가지고 도대체 몇시간을 ㅠ.ㅠ
질문은 두가지 인데요..
1.
DirectoryListBox1->Drive = FileListBox1->Drive = DriveComboBox1->Drive;
왜 이게 밑의 에러가 나지요?
[C++ Error] Unit1.cpp(24): E2492 Properties may only be assigned using a simple statement, e.g. "prop = value;"
[C++ Error] Unit1.cpp(24): E2369 Cannot use the result of a property assignment as an rvalue
2.
밑의 프로그램이 왜 소스 폴더와 타겟 폴더가 같게 만들어서 폴더가 동일하다는 에러를 내고난 뒤에
소스 폴더를 바꾸지 않은면 파일이 없다는 에러가 나는 지 모르겠어요..
소스 폴더를 바꾸면 파일이 없다는 에러가 나오지 않거든요..
아.. 그리고 1번의 에러 때문에 그 명령을
DirectoryListBox1->Drive = DriveComboBox1->Drive;
FileListBox1->Drive = DriveComboBox1->Drive;
이렇게 바꿨구여... 바꾸지 않으면
[C++ Error] Unit1.cpp(45): E2096 Illegal structure operation
[C++ Error] Unit1.cpp(48): E2093 'operator!' not implemented in type 'AnsiString' for arguments of the same type
if ( DirectoryListBox1->Directory != DirectoryListBox2->Directory ) { => 45번행
if (!FileExists(FileListBox1->Items->Strings[i])) { => 48번행
이런 에러가 추가 되는 군요..
밑은 프로그램이구요.. 첨부는 전체입니다..
void __fastcall TForm1::DriveComboBox1Change(TObject *Sender)
{
DirectoryListBox1->Drive = DriveComboBox1->Drive;
FileListBox1->Drive = DriveComboBox1->Drive;
FileListBox1->Directory = DirectoryListBox1->Directory;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::DirectoryListBox1Change(TObject *Sender)
{
FileListBox1->Directory = DirectoryListBox1->Directory;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::DriveComboBox2Change(TObject *Sender)
{
DirectoryListBox2->Drive = DriveComboBox2->Drive;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if ( DirectoryListBox1->Directory != DirectoryListBox2->Directory ) {
for (int i = 0; i < FileListBox1->Items->Count; i++) {
if (FileListBox1->Selected[i]) {
if (!FileExists(FileListBox1->Items->Strings[i])) {
MessageDlg("File이 없습니다.", mtError, TMsgDlgButtons() << mbYes , 0);
}
}
}
}
else
MessageDlg("Source 폴더와 Target 폴더가 같습니다.", mtError, TMsgDlgButtons() << mbYes , 0);
}
도움을 주시면 정말 감사 하겠습니다.. ^^;
|