Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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; } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TripleDESCryptoServiceProvider.cs
- AnimatedTypeHelpers.cs
- AlgoModule.cs
- XmlRawWriter.cs
- Location.cs
- PerspectiveCamera.cs
- XmlReflectionMember.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- LogPolicy.cs
- GeometryCollection.cs
- ZoneButton.cs
- RangeBase.cs
- TypeValidationEventArgs.cs
- StaticFileHandler.cs
- XmlNotation.cs
- AnimationStorage.cs
- InvalidateEvent.cs
- TreeViewImageIndexConverter.cs
- IdentitySection.cs
- TypeSystem.cs
- ServiceOperationListItem.cs
- HitTestWithGeometryDrawingContextWalker.cs
- StoragePropertyMapping.cs
- FontEditor.cs
- TextWriter.cs
- CollectionEditorDialog.cs
- DockAndAnchorLayout.cs
- SqlWorkflowPersistenceService.cs
- ListViewAutomationPeer.cs
- VarRefManager.cs
- WebPartVerbsEventArgs.cs
- LinkUtilities.cs
- FusionWrap.cs
- ProgressPage.cs
- COM2ExtendedBrowsingHandler.cs
- DeferredRunTextReference.cs
- JulianCalendar.cs
- ForEachAction.cs
- Rotation3DAnimation.cs
- SystemColors.cs
- DesignBindingEditor.cs
- FixedDocument.cs
- OpCellTreeNode.cs
- AllMembershipCondition.cs
- translator.cs
- ReadOnlyDictionary.cs
- DataTableCollection.cs
- StylusPlugInCollection.cs
- TakeQueryOptionExpression.cs
- UserPreferenceChangedEventArgs.cs
- ScopedMessagePartSpecification.cs
- propertyentry.cs
- TextTreeRootTextBlock.cs
- WebControl.cs
- PackagePartCollection.cs
- TransactionManagerProxy.cs
- DataServices.cs
- SpeechDetectedEventArgs.cs
- SiteMapDataSourceView.cs
- SmtpNtlmAuthenticationModule.cs
- MobileCapabilities.cs
- TypeHelper.cs
- PtsHelper.cs
- DataTableMappingCollection.cs
- TableRowGroup.cs
- XmlHelper.cs
- XamlStyleSerializer.cs
- ToolStripMenuItem.cs
- MetafileHeaderWmf.cs
- DataGridViewUtilities.cs
- PolyLineSegment.cs
- TransportContext.cs
- DBBindings.cs
- sqlstateclientmanager.cs
- CompiledQueryCacheEntry.cs
- StylusPointPropertyInfoDefaults.cs
- StorageMappingFragment.cs
- complextypematerializer.cs
- AbstractDataSvcMapFileLoader.cs
- CopyOfAction.cs
- CssStyleCollection.cs
- SqlUserDefinedTypeAttribute.cs
- ReadOnlyPropertyMetadata.cs
- AssemblyNameProxy.cs
- AttributeAction.cs
- DrawTreeNodeEventArgs.cs
- ControlBuilderAttribute.cs
- ActivityExecutorDelegateInfo.cs
- WmlCommandAdapter.cs
- Single.cs
- Int64KeyFrameCollection.cs
- XmlSchemaValidator.cs
- UnSafeCharBuffer.cs
- GregorianCalendarHelper.cs
- MemberAccessException.cs
- MonthChangedEventArgs.cs
- DefaultObjectMappingItemCollection.cs
- FormViewModeEventArgs.cs
- HotSpotCollection.cs
- AssertSection.cs