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
- FixedSOMImage.cs
- CalculatedColumn.cs
- ManifestResourceInfo.cs
- ImpersonateTokenRef.cs
- WebEventCodes.cs
- SqlDependency.cs
- cache.cs
- DirectoryInfo.cs
- RelationshipFixer.cs
- StreamInfo.cs
- ColumnTypeConverter.cs
- AmbientValueAttribute.cs
- PointLight.cs
- DataViewManagerListItemTypeDescriptor.cs
- FunctionQuery.cs
- HttpCacheVary.cs
- Utils.cs
- BufferModeSettings.cs
- ListBoxItem.cs
- UnsafeNativeMethods.cs
- DesignerToolStripControlHost.cs
- AspNetSynchronizationContext.cs
- SwitchExpression.cs
- ResXResourceReader.cs
- ManagedIStream.cs
- SystemIPv6InterfaceProperties.cs
- StoreContentChangedEventArgs.cs
- PropertySegmentSerializationProvider.cs
- TextEditorCharacters.cs
- BigInt.cs
- DetailsViewUpdatedEventArgs.cs
- PaperSource.cs
- ImageBrush.cs
- BinHexEncoder.cs
- MessageDroppedTraceRecord.cs
- Image.cs
- TextRange.cs
- Directory.cs
- Sequence.cs
- autovalidator.cs
- HostingEnvironment.cs
- CounterSample.cs
- ControlOperationBehavior.cs
- PartitionResolver.cs
- ReflectPropertyDescriptor.cs
- CacheRequest.cs
- ContourSegment.cs
- InvocationExpression.cs
- Stack.cs
- Vector.cs
- Panel.cs
- LicenseManager.cs
- WindowCollection.cs
- TransformValueSerializer.cs
- EmptyStringExpandableObjectConverter.cs
- ParallelRangeManager.cs
- AdRotator.cs
- GAC.cs
- MethodCallConverter.cs
- DescriptionAttribute.cs
- TextTreeInsertUndoUnit.cs
- SlotInfo.cs
- MultipartContentParser.cs
- ASCIIEncoding.cs
- PrintPageEvent.cs
- Baml2006KnownTypes.cs
- TypedRowGenerator.cs
- ConnectionStringsExpressionBuilder.cs
- HtmlFormWrapper.cs
- XsdBuildProvider.cs
- JobDuplex.cs
- OleDbPermission.cs
- Int32.cs
- KnownColorTable.cs
- RelationshipManager.cs
- TraceContextRecord.cs
- PrintDocument.cs
- GenericTransactionFlowAttribute.cs
- HtmlControl.cs
- BufferModeSettings.cs
- TransformerInfoCollection.cs
- ChannelManager.cs
- WebEventCodes.cs
- FormatterServices.cs
- EnglishPluralizationService.cs
- DotExpr.cs
- ObfuscationAttribute.cs
- BufferedGraphics.cs
- ReferencedType.cs
- OleDbConnectionInternal.cs
- SqlRewriteScalarSubqueries.cs
- TableColumn.cs
- entitydatasourceentitysetnameconverter.cs
- DataServiceOperationContext.cs
- Attachment.cs
- QuaternionAnimation.cs
- AppDomainUnloadedException.cs
- ProfileGroupSettingsCollection.cs
- CompiledRegexRunner.cs
- TrackingServices.cs