TStringList *OldDrives;
OldDrives = new TStringList;
OldDrives->Assign(DriveBox->Items); // Remember old drive list
// Show the connection dialog
if (WNetConnectionDialog(Application->Handle,RESOURCETYPE_DISK) == NO_ERROR){
DriveBox->TextCase = tcLowerCase; // Refresh the drive list box
for (int i=0;DriveBox->Items->Count - 1;i++){
// AnsiString S=(TString*)DriveBox->Items[i];
if (OldDrives->IndexOf(DriveBox->Items[i]) == -1){ // Find new Drive letter
DriveBox->ItemIndex = i; // Updates the drive list box to new drive // letter
DriveBox->Drive = DriveBox->Text[1]; // Cascades the update to connected directory // lists, etc
}
}
DriveBox->SetFocus();
}
위에 것은 네트웍드라이브에 연결시키는 소스입니다.
그런데 중간에 OldDrives->IndexOf(DriveBox->Items[i] 부분에서
할당이 잘못됐다고 에러가 발생합니다.
어떻게 해결해야 할지 모르겠어요..
가르쳐 주세요
그럼 안녕히 계세요.
건강하시고요.
|