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
- MD5CryptoServiceProvider.cs
- ScriptingProfileServiceSection.cs
- SchemaLookupTable.cs
- TargetPerspective.cs
- TypeExtensions.cs
- SendSecurityHeaderElementContainer.cs
- SchemaImporterExtensionElementCollection.cs
- XmlBinaryReaderSession.cs
- CollaborationHelperFunctions.cs
- PersonalizationProvider.cs
- CollectionViewSource.cs
- _ServiceNameStore.cs
- DependencyPropertyAttribute.cs
- TypeUtil.cs
- ByteKeyFrameCollection.cs
- VirtualizedContainerService.cs
- Int64Storage.cs
- TextCharacters.cs
- ProjectionPathSegment.cs
- FlowPosition.cs
- DataGridViewButtonCell.cs
- QueryableDataSourceView.cs
- TimeZoneInfo.cs
- HwndMouseInputProvider.cs
- TransformPatternIdentifiers.cs
- VoiceObjectToken.cs
- ListViewSelectEventArgs.cs
- Helpers.cs
- Point4D.cs
- BitmapEffectInput.cs
- FrameworkPropertyMetadata.cs
- IFormattable.cs
- EasingFunctionBase.cs
- ScalarOps.cs
- MailMessage.cs
- SafeCryptContextHandle.cs
- ProcessRequestArgs.cs
- UrlPropertyAttribute.cs
- COM2ColorConverter.cs
- EDesignUtil.cs
- HtmlSelect.cs
- RbTree.cs
- WebPartsSection.cs
- AssertHelper.cs
- SupportingTokenSecurityTokenResolver.cs
- TemplateControlCodeDomTreeGenerator.cs
- IncrementalCompileAnalyzer.cs
- DataTemplateKey.cs
- SingleSelectRootGridEntry.cs
- DiscoveryClientDuplexChannel.cs
- TemplateBindingExtensionConverter.cs
- BufferAllocator.cs
- StrokeCollection2.cs
- PolicyException.cs
- ObjectStorage.cs
- BindingsCollection.cs
- StringConverter.cs
- SQLInt64Storage.cs
- DeviceContext.cs
- GridViewRowCollection.cs
- SqlConnectionManager.cs
- ServerIdentity.cs
- ProviderCommandInfoUtils.cs
- StateMachineSubscription.cs
- DynamicDataRouteHandler.cs
- Message.cs
- DataGridViewRowHeaderCell.cs
- IconHelper.cs
- NullableFloatMinMaxAggregationOperator.cs
- ColumnTypeConverter.cs
- ConfigurationValidatorBase.cs
- XmlILAnnotation.cs
- MissingManifestResourceException.cs
- PartialCachingAttribute.cs
- DetailsViewPageEventArgs.cs
- SqlStatistics.cs
- WebContext.cs
- SecurityStateEncoder.cs
- XmlEncodedRawTextWriter.cs
- DataGrid.cs
- DataServicePagingProviderWrapper.cs
- UpdateManifestForBrowserApplication.cs
- FileChangeNotifier.cs
- PrinterResolution.cs
- SchemaObjectWriter.cs
- OleDbInfoMessageEvent.cs
- IncrementalHitTester.cs
- ListItemsPage.cs
- ScriptRegistrationManager.cs
- SelectorItemAutomationPeer.cs
- ReachDocumentSequenceSerializerAsync.cs
- WorkflowRuntimeServiceElementCollection.cs
- TimeoutException.cs
- SqlBooleanMismatchVisitor.cs
- Mapping.cs
- PenThread.cs
- ImpersonateTokenRef.cs
- NavigationPropertySingletonExpression.cs
- _SecureChannel.cs
- TableLayoutCellPaintEventArgs.cs