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
- KernelTypeValidation.cs
- ListDictionaryInternal.cs
- FontFamily.cs
- OneWayBindingElement.cs
- Effect.cs
- SoapEnumAttribute.cs
- EllipseGeometry.cs
- DataStreamFromComStream.cs
- AsyncStreamReader.cs
- SyndicationFeedFormatter.cs
- TraceLevelHelper.cs
- InputLangChangeRequestEvent.cs
- RegexCompilationInfo.cs
- EnumType.cs
- XPathSingletonIterator.cs
- HScrollProperties.cs
- IisTraceWebEventProvider.cs
- FileDataSource.cs
- RowParagraph.cs
- QilFunction.cs
- SubpageParaClient.cs
- ChildrenQuery.cs
- WebResourceUtil.cs
- WindowsListView.cs
- ILGenerator.cs
- SqlCacheDependencySection.cs
- SmtpLoginAuthenticationModule.cs
- ErrorEventArgs.cs
- DataGridRowHeader.cs
- MimeXmlReflector.cs
- TableLayoutPanelCellPosition.cs
- SmtpReplyReader.cs
- DesignSurfaceEvent.cs
- ErrorsHelper.cs
- ToolStripScrollButton.cs
- SqlExpander.cs
- HwndAppCommandInputProvider.cs
- OptimalTextSource.cs
- InputLanguageSource.cs
- Validator.cs
- StringArrayEditor.cs
- Content.cs
- DiscreteKeyFrames.cs
- RequiredFieldValidator.cs
- PnrpPermission.cs
- TraceInternal.cs
- MemoryFailPoint.cs
- WebConfigurationHost.cs
- Literal.cs
- ObjectContextServiceProvider.cs
- ConfigurationElementCollection.cs
- StringArrayConverter.cs
- WhitespaceRule.cs
- X509UI.cs
- ProfileBuildProvider.cs
- MetaModel.cs
- TableDesigner.cs
- __ComObject.cs
- ListSortDescriptionCollection.cs
- TabItemWrapperAutomationPeer.cs
- TypedMessageConverter.cs
- SQLInt32Storage.cs
- AnimationClock.cs
- IPPacketInformation.cs
- XPathBinder.cs
- HuffmanTree.cs
- X509RecipientCertificateClientElement.cs
- ServicePointManager.cs
- FontFamilyConverter.cs
- ProcessStartInfo.cs
- TextServicesContext.cs
- XmlElementAttribute.cs
- LongTypeConverter.cs
- DBCommandBuilder.cs
- MetricEntry.cs
- NamedPipeActivation.cs
- CultureSpecificCharacterBufferRange.cs
- ProtocolInformationWriter.cs
- ForceCopyBuildProvider.cs
- DataMisalignedException.cs
- HierarchicalDataBoundControl.cs
- GPPOINT.cs
- FileInfo.cs
- MarkerProperties.cs
- FastEncoder.cs
- StyleSheetRefUrlEditor.cs
- ResetableIterator.cs
- DetailsViewUpdatedEventArgs.cs
- SafeFileMapViewHandle.cs
- DbMetaDataCollectionNames.cs
- HwndMouseInputProvider.cs
- QilLoop.cs
- DesignerImageAdapter.cs
- Activity.cs
- InvokeAction.cs
- LocationReferenceValue.cs
- MessageBox.cs
- ScriptComponentDescriptor.cs
- CmsUtils.cs
- LinqDataSourceStatusEventArgs.cs