XceedZipLib.XceedZipClass loZipper
try
{
loZipper = new XceedZipLib.XceedZipClass();
}
catch
{
MessageBox.Show("Please check to make sure you have the Xceed Zip Compression Library installed",
"Error: Missing Required Files", MessageBoxButtons.OK, MessageBoxIcon.Stop);
return false;
}
Is not the correct way because 1)Hide the others possible error 2)the construc is not in the scope. With try..any and object instantation:
Declare Object
Create Object
try
Accionts
catch
Manage Errors
finally
//not if the object is public or must be returned
Release Object/Close object
end
So i suggest:
Private function GetZip:XceedZipLib.XceedZipClass
loZipper as XceedZipLib.XceedZipClass
loZipper = new XceedZipLib.XceedZipClass()
return loZipper
End Function
funtion Main
loZipper as XceedZipLib.XceedZipClass
try
loZipper=GetZip()
...
catch
Please trap ONLY the creation error, never hide the others
end
End Function
The Life is Beautiful!
Programmer in
Delphi, VS.NET
MCP