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
- UInt64.cs
- AttributeCollection.cs
- ServerIdentity.cs
- ReliabilityContractAttribute.cs
- ThicknessAnimationBase.cs
- SecurityProtocolCorrelationState.cs
- ConnectionModeReader.cs
- ActivityWithResult.cs
- RawStylusSystemGestureInputReport.cs
- TableLayoutPanelCellPosition.cs
- OleDbInfoMessageEvent.cs
- LinkDescriptor.cs
- TypedElement.cs
- SelectionRangeConverter.cs
- XmlDataLoader.cs
- KeyValuePairs.cs
- DataViewSettingCollection.cs
- CatalogPartChrome.cs
- GridViewUpdateEventArgs.cs
- FigureParaClient.cs
- latinshape.cs
- TriggerActionCollection.cs
- FixedSOMLineRanges.cs
- UnhandledExceptionEventArgs.cs
- StaticDataManager.cs
- DataGridViewRowCancelEventArgs.cs
- QueryOutputWriter.cs
- RecognitionResult.cs
- EditorOptionAttribute.cs
- StringTraceRecord.cs
- ContextStack.cs
- X509Certificate2.cs
- GrammarBuilder.cs
- Publisher.cs
- WorkflowServiceNamespace.cs
- SqlBulkCopyColumnMapping.cs
- MsdtcClusterUtils.cs
- FormattedTextSymbols.cs
- DataBindingExpressionBuilder.cs
- CatalogZoneAutoFormat.cs
- ToolStripContainerDesigner.cs
- MimePart.cs
- HttpChannelHelpers.cs
- FormViewUpdatedEventArgs.cs
- ResourceDictionary.cs
- PropertyCondition.cs
- HandoffBehavior.cs
- SmtpNetworkElement.cs
- ControlParser.cs
- RegexStringValidatorAttribute.cs
- DataGridViewIntLinkedList.cs
- Timer.cs
- parserscommon.cs
- ServiceMetadataExtension.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- IssuedTokenParametersEndpointAddressElement.cs
- SymDocumentType.cs
- HtmlControl.cs
- TextElementCollectionHelper.cs
- TableLayoutSettings.cs
- WindowProviderWrapper.cs
- LocationSectionRecord.cs
- TextComposition.cs
- DynamicQueryStringParameter.cs
- EventProviderClassic.cs
- SystemWebSectionGroup.cs
- DataServiceContext.cs
- KoreanCalendar.cs
- wgx_commands.cs
- NavigationExpr.cs
- DependencyObjectProvider.cs
- DataGridViewAutoSizeModeEventArgs.cs
- MarkupCompilePass2.cs
- DocumentViewer.cs
- WindowsImpersonationContext.cs
- ILGenerator.cs
- TextDpi.cs
- RegexWorker.cs
- ControlAdapter.cs
- EmulateRecognizeCompletedEventArgs.cs
- SmtpAuthenticationManager.cs
- WebPartCatalogCloseVerb.cs
- WebPartTransformerAttribute.cs
- DbParameterCollectionHelper.cs
- StatusBar.cs
- ResourceReferenceExpression.cs
- FilteredAttributeCollection.cs
- XmlSerializer.cs
- LifetimeServices.cs
- WindowsUpDown.cs
- DbProviderFactories.cs
- SqlBulkCopy.cs
- XPathDocumentNavigator.cs
- CLSCompliantAttribute.cs
- StorageBasedPackageProperties.cs
- SingleAnimationBase.cs
- HwndHostAutomationPeer.cs
- UnsafeNativeMethods.cs
- BitVec.cs
- EntitySqlQueryBuilder.cs