TRY *-- Create zipper object loZipper = CREATEOBJECT( "XceedSoftware.XceedZip.4" ) CATCH ENDTRY IF TYPE("loZipper") <> "O" * Could not create zip object, probably don't have the Xceed components installed MESSAGEBOX("Please check to make sure you have the Xceed Zip Compression Library installed", ; 0 + 16,"Error: Missing Required Files") RETURN .F. ENDIFHowever, if I try to do the following in C#:
try { XceedZipLib.XceedZipClass 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; } loZipper.PreservePaths = false; loZipper.FilesToProcess = ...I get an error saying that "The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?)" when I try to do anything with the loZipper object. If remove the try-catch, everything is fine. Why does the scope change in the try-catch?