Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to trap COM instantiation
Message
De
31/07/2003 16:02:06
 
 
À
31/07/2003 15:53:04
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00815490
Message ID:
00815598
Vues:
10
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform