Are you saying you want to know what the COM error was or want more details
than what it provides you?
The COMException has an ErrorCode property that you can use to get the exact
error codes, but they aren't much more helpful than the error messages
except for handling them programmatically.
If you want more details about the underlying failure, the only way I know
is to p/invoke ADsGetLastError. I might have a sample somewhere if I look
around.
Throwing an ApplicationException won't help you unless I totally don't
understand what you want to do.
Joe K.
<dl> wrote in message news:...
> Hi
> Is there a way to find out what COMException is being thrown as a result
> of
> an operation, for example
>
> DirectoryEntry newUser = entry.Children.Add(<newuser_CNname>, "user")
>
> I suppose this one would throw a COMException if a duplicate CNname is
> found. But if other operations, coming after this one, would also throw
> COMExceptions, then how can I differentiate the COMException thrown by
> each
> operation as the COMException error message doesn't seems to provide
> specific information. Do I need to throw ApplicationException in this
> case?
> In order to do that, do I need to define my own class of
> ApplicationException?
>
> TIA
>
> --
>
>
>
|