Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / clr / src / BCL / System / Runtime / InteropServices / COMException.cs / 1 / COMException.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: COMException ** ** ** Purpose: Exception class for all errors from COM Interop where we don't ** recognize the HResult. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System.Runtime.InteropServices; using System; using System.Runtime.Serialization; using System.Globalization; // Exception for COM Interop errors where we don't recognize the HResult. // [System.Runtime.InteropServices.ComVisible(true)] [Serializable()] public class COMException : ExternalException { public COMException() : base(Environment.GetResourceString("Arg_COMException")) { SetErrorCode(__HResults.E_FAIL); } public COMException(String message) : base(message) { SetErrorCode(__HResults.E_FAIL); } public COMException(String message, Exception inner) : base(message, inner) { SetErrorCode(__HResults.E_FAIL); } public COMException(String message,int errorCode) : base(message) { SetErrorCode(errorCode); } protected COMException(SerializationInfo info, StreamingContext context) : base(info, context) { } public override String ToString() { String message = Message; String s; String _className = GetType().ToString(); s = _className + " (0x" + HResult.ToString("X8", CultureInfo.InvariantCulture) + ")"; if (!(message == null || message.Length <= 0)) { s = s + ": " + message; } Exception _innerException = InnerException; if (_innerException!=null) { s = s + " ---> " + _innerException.ToString(); } if (StackTrace != null) s += Environment.NewLine + StackTrace; return s; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================================== ** ** Class: COMException ** ** ** Purpose: Exception class for all errors from COM Interop where we don't ** recognize the HResult. ** ** =============================================================================*/ namespace System.Runtime.InteropServices { using System.Runtime.InteropServices; using System; using System.Runtime.Serialization; using System.Globalization; // Exception for COM Interop errors where we don't recognize the HResult. // [System.Runtime.InteropServices.ComVisible(true)] [Serializable()] public class COMException : ExternalException { public COMException() : base(Environment.GetResourceString("Arg_COMException")) { SetErrorCode(__HResults.E_FAIL); } public COMException(String message) : base(message) { SetErrorCode(__HResults.E_FAIL); } public COMException(String message, Exception inner) : base(message, inner) { SetErrorCode(__HResults.E_FAIL); } public COMException(String message,int errorCode) : base(message) { SetErrorCode(errorCode); } protected COMException(SerializationInfo info, StreamingContext context) : base(info, context) { } public override String ToString() { String message = Message; String s; String _className = GetType().ToString(); s = _className + " (0x" + HResult.ToString("X8", CultureInfo.InvariantCulture) + ")"; if (!(message == null || message.Length <= 0)) { s = s + ": " + message; } Exception _innerException = InnerException; if (_innerException!=null) { s = s + " ---> " + _innerException.ToString(); } if (StackTrace != null) s += Environment.NewLine + StackTrace; return s; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UInt64Storage.cs
- BindingCollection.cs
- InternalPermissions.cs
- JapaneseCalendar.cs
- SubstitutionDesigner.cs
- TdsParserHelperClasses.cs
- ConfigXmlDocument.cs
- SafeViewOfFileHandle.cs
- EditableRegion.cs
- ListControlActionList.cs
- DataSpaceManager.cs
- RolePrincipal.cs
- Propagator.cs
- MaterialCollection.cs
- AttributeCollection.cs
- ConstraintManager.cs
- WebChannelFactory.cs
- HtmlInputText.cs
- ProviderConnectionPointCollection.cs
- ToolStripSettings.cs
- FlowDocument.cs
- HttpListenerResponse.cs
- GridViewRowEventArgs.cs
- ExtensibleSyndicationObject.cs
- SqlDataSourceQuery.cs
- UnmanagedMarshal.cs
- UIElement.cs
- OutputCacheModule.cs
- Line.cs
- LockCookie.cs
- _NegotiateClient.cs
- ProcessHostServerConfig.cs
- BitVector32.cs
- IOThreadScheduler.cs
- CmsInterop.cs
- RadioButtonList.cs
- FileSystemWatcher.cs
- BinaryOperationBinder.cs
- DeclarationUpdate.cs
- WinEventHandler.cs
- SynthesizerStateChangedEventArgs.cs
- Deflater.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- SoapEnumAttribute.cs
- ObsoleteAttribute.cs
- ArgumentReference.cs
- HandlerWithFactory.cs
- TabletCollection.cs
- DataGridViewColumnConverter.cs
- AmbiguousMatchException.cs
- CLSCompliantAttribute.cs
- DesignTimeParseData.cs
- WinInet.cs
- SafeUserTokenHandle.cs
- ConfigurationConverterBase.cs
- IChannel.cs
- CreateBookmarkScope.cs
- Shape.cs
- DataRecordInfo.cs
- RenderData.cs
- GridErrorDlg.cs
- DataGridViewRow.cs
- WindowsStartMenu.cs
- TrimSurroundingWhitespaceAttribute.cs
- DefaultPrintController.cs
- SerialPinChanges.cs
- FontSource.cs
- BitConverter.cs
- Compiler.cs
- QuadraticBezierSegment.cs
- SmtpTransport.cs
- LinkLabelLinkClickedEvent.cs
- TeredoHelper.cs
- AggregationMinMaxHelpers.cs
- AudioLevelUpdatedEventArgs.cs
- DesignerTransactionCloseEvent.cs
- KeyboardEventArgs.cs
- ErasingStroke.cs
- MenuItemStyleCollection.cs
- SaveWorkflowAsyncResult.cs
- Executor.cs
- NextPreviousPagerField.cs
- DoubleStorage.cs
- XhtmlBasicLiteralTextAdapter.cs
- VisualBasic.cs
- ChangesetResponse.cs
- DataGridViewDataErrorEventArgs.cs
- HtmlElementErrorEventArgs.cs
- SkinBuilder.cs
- EntityPropertyMappingAttribute.cs
- CodeVariableReferenceExpression.cs
- BStrWrapper.cs
- XmlSchemaInferenceException.cs
- DynamicDocumentPaginator.cs
- MultipleViewProviderWrapper.cs
- FirewallWrapper.cs
- GridViewAutomationPeer.cs
- CharacterString.cs
- SelectionList.cs
- LineMetrics.cs