프로그램 수행도중 다음 함수를 처리하는데 BuildAll 을 하면
( Variable 'DriveComboBox' might not have been initialized ) 라는 메세지를
가지는 Warning 이 발생합니다. 도대체 이유가 무엇인지요 그리고
해결 방법은 무엇인지요 가르쳐 주시면 감사하겠습니다.
function GetCDRomVolumeName(sDrive:String):String;
var
DriveComboBox:TDriveComboBox;
begin
Result:='';
if Length(sDrive)<=0 then exit;
try
DriveComboBox:=TDriveComboBox.Create(Application.Mainform);
if DriveComboBox=nil then exit;
DriveComboBox.Visible:=FALSE;
DriveComboBox.Parent:=Application.Mainform;
DriveComboBox.TextCase:=tcUpperCase;
DriveComboBox.Drive:=sDrive[1];
Result:=Copy(DriveComboBox.Text,5,Length(DriveComboBox.Text)-5);
except
if DriveComboBox <> nil then DriveComboBox.Free; / 이곳에서 warning 이 발생함 /
end;
DriveComboBox.Free;
end;
|