How to catch COM exception in .Net

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default How to catch COM exception in .Net

    Ok, I do have a COM dll written in C++. Then a web service written in C# is
    referencing this COM dll. Here everything is fine.

    Now I have for exemple this line in my COM, that is called from the
    Webservice.
    hr = pSavi->SweepFile( ..., ..., ...)

    BUT, this line sometimes fails, How from my webservice can I catch the HR
    result ??

    Thanks for your help



    Franck


    Franck Guest

  2. Similar Questions and Discussions

    1. Catch VideoError exception?
      Is there a way to catch VideoError exceptions thrown by the VideoDisplay class? I've tried wrapping it in try/catch, but it seems to be thrown...
    2. #40456 [NEW]: php5.2.1 - Uncaught exception try/catch
      From: zeldign at zeldign dot com Operating system: CentOS 4.4 PHP version: 5.2.1 PHP Bug Type: Scripting Engine problem Bug...
    3. What exception should I catch ??
      I've read somewhere that it's not a good idea (or design) to catch all exception in one (big) catch(Exception e)... but instead catch the...
    4. ASP catch exception
      I use the following code and get the following error message in my ASP page(not .net). Please help try mycode Catch ex As Exception...
    5. Catch Exception Error Message
      You can put your code between (try-catch-end try) block in codebehind and catch the exception by response.write(exception_name.message) frank...
  3. #2

    Default Re: How to catch COM exception in .Net

    Hi,

    Use ExternalException ErrorCode property.

    Natty Gur, CTO
    Dao2Com Ltd.
    34th Elkalay st. Raanana
    Israel , 43000
    Phone Numbers:
    Office: +972-(0)9-7740261
    Fax: +972-(0)9-7740261
    Mobile: +972-(0)58-888377


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Natty Gur Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139