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
- Grammar.cs
- BitmapSourceSafeMILHandle.cs
- MultipleViewPattern.cs
- SessionEndingEventArgs.cs
- RelationshipEnd.cs
- XmlLoader.cs
- CharacterBufferReference.cs
- StylusCaptureWithinProperty.cs
- HopperCache.cs
- TreeViewImageKeyConverter.cs
- XmlReflectionMember.cs
- FactoryId.cs
- HistoryEventArgs.cs
- _RequestCacheProtocol.cs
- CursorConverter.cs
- DataSourceXmlTextReader.cs
- FormatConvertedBitmap.cs
- UnknownWrapper.cs
- DbException.cs
- TextContainerHelper.cs
- MsmqElementBase.cs
- PageRanges.cs
- StringReader.cs
- EditorAttribute.cs
- TextReader.cs
- ValidationResult.cs
- DataGridViewRowPostPaintEventArgs.cs
- CultureNotFoundException.cs
- ByteAnimationBase.cs
- MatrixStack.cs
- GregorianCalendarHelper.cs
- BadImageFormatException.cs
- SamlAudienceRestrictionCondition.cs
- IisHelper.cs
- LongTypeConverter.cs
- MetadataItemEmitter.cs
- XmlSchemaSubstitutionGroup.cs
- SystemWebSectionGroup.cs
- FixedSOMElement.cs
- BigIntegerStorage.cs
- FontEmbeddingManager.cs
- Effect.cs
- PackWebResponse.cs
- HttpDictionary.cs
- ScriptRef.cs
- DataGridViewSelectedColumnCollection.cs
- CachingHintValidation.cs
- FilterEventArgs.cs
- ToolboxItemWrapper.cs
- DataGridPreparingCellForEditEventArgs.cs
- OpenFileDialog.cs
- InternalBufferOverflowException.cs
- Socket.cs
- Light.cs
- XsltFunctions.cs
- XPathNodeList.cs
- InstancePersistence.cs
- XmlCountingReader.cs
- PolicyStatement.cs
- DataGridComponentEditor.cs
- ValidationHelper.cs
- ConfigurationException.cs
- RSACryptoServiceProvider.cs
- ExpressionBuilder.cs
- WebHeaderCollection.cs
- ConstrainedGroup.cs
- DelegatingTypeDescriptionProvider.cs
- GridViewItemAutomationPeer.cs
- CannotUnloadAppDomainException.cs
- BaseParagraph.cs
- MultiSelectRootGridEntry.cs
- _FtpControlStream.cs
- CfgParser.cs
- ScriptServiceAttribute.cs
- CollectionDataContract.cs
- InsufficientMemoryException.cs
- WebPartTransformerAttribute.cs
- altserialization.cs
- PrintPageEvent.cs
- ObjectToModelValueConverter.cs
- ObjectListCommandCollection.cs
- FixedHyperLink.cs
- BasePattern.cs
- WebRequestModuleElement.cs
- ClrPerspective.cs
- DataServiceRequestOfT.cs
- DataGridViewCellFormattingEventArgs.cs
- WeakEventManager.cs
- EventLogInternal.cs
- AppModelKnownContentFactory.cs
- DataGridAutoFormatDialog.cs
- UInt32Converter.cs
- BorderGapMaskConverter.cs
- SmtpClient.cs
- EventProviderBase.cs
- HijriCalendar.cs
- CodeDomSerializerBase.cs
- ButtonBase.cs
- SafeLocalMemHandle.cs
- SendMailErrorEventArgs.cs