RE: COM Exception handling
From: /dev/null (devnull_at_discussions.microsoft.com)
Date: 11/11/04
- Next message: Patrick: "Re: Handling Script Timeout when invoking ActiveX Object"
- Previous message: Hasani: "How can one specify which version of an assembly to load from the GAC"
- In reply to: /dev/null: "COM Exception handling"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 11 Nov 2004 07:28:15 -0800
My coworker found the simplest of solutions to this problem.
dim ex2 as System.Runtime.InteropServices.COMException
ex2 = ex.InnerException
I was then able to get access to the errorcode method
"/dev/null" wrote:
> I built a little asp.net form to let our users change their password, it's
> simple and works pretty well. I'd like to be able to treat exceptions
> properly but i am having trouble finding what's really going on.
>
> I am using this command to change the password :
> Entree.Invoke("ChangePassword", New Object() {OldPassword, NewPassword})
>
> This will trigger an exception when some situations are encountered. the
> exception name is the same whether the new password is not following the
> rules or if the old password is incorrect.
>
> Putting a breakpoint when an exception occurs, i can see using the "Autos"
> debug window that somewhere inside the Exception object, there is an error
> code. I can't figure out how to get to it using code... This error code
> isn't the same when the user enters an incorrect current password or does not
> repect the rules for new passwords.
>
> I get in the command window:
>
> ? ex.innerexception
> {System.Runtime.InteropServices.COMException}
> [System.Runtime.InteropServices.COMException]:
> {System.Runtime.InteropServices.COMException}
> HelpLink: Nothing
> InnerException: Nothing
> Message: "The specified network password is not correct."
> Source: ""
> StackTrace: Nothing
> TargetSite: Nothing
>
> In the "Autos" window i see that the 2nd line i get in the command window is
> expanded and shows the error code. How can i get access to what's inside
> "[System.Runtime.InteropServices.COMException]:
> {System.Runtime.InteropServices.COMException}"
>
> Thanks
- Next message: Patrick: "Re: Handling Script Timeout when invoking ActiveX Object"
- Previous message: Hasani: "How can one specify which version of an assembly to load from the GAC"
- In reply to: /dev/null: "COM Exception handling"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|