Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to trap COM instantiation
Message
From
31/07/2003 16:02:06
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00815490
Message ID:
00815598
Views:
9
Brian,

Yeah, duh, I wasn't thinking. What I should have suggested was to put *everything* in the try, like this:
try
{
  XceedZipLib.XceedZipClass loZipper = new XceedZipLib.ZceedZipClass();
  loZipper.PreservePaths = false;
  loZipper.FilesToProcess = etc....

}
catch
{
   MessageBox.Show("etc.");
}
~~Bonnie


>Brian,
>>
>>How about this:
>>
>>object loZipper;
>>try
>>{
>>   // etc.
>>}
>>//  etc.
>>
>>
>>~~Bonnie
>

>
>
>Hi Bonnie,
>
>That too will cause the compile error:
>
>A local variable named 'loZipper' cannot be declared in this scope because it would give a different meaning to 'loZipper', which is already used in a 'parent or current' scope to denote something else
>
>Plus, I lose the intellisense since the loZipper declaration in scope outside of the try-catch is simply object. I think I'm just going to drop the try-catch all together.
>
>I would think trapping for this kind of thing would be a common need, no?
>
>
>- Brian
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform