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
- ByteStream.cs
- MetadataArtifactLoaderFile.cs
- recordstatefactory.cs
- CLRBindingWorker.cs
- DataErrorValidationRule.cs
- CompatibleComparer.cs
- AffineTransform3D.cs
- PerformanceCounter.cs
- NumberAction.cs
- SecurityState.cs
- ManagementInstaller.cs
- FixedSOMGroup.cs
- CounterSampleCalculator.cs
- WmlPageAdapter.cs
- XMLDiffLoader.cs
- Style.cs
- HttpApplication.cs
- ExpressionPrefixAttribute.cs
- ThreadExceptionEvent.cs
- DataGridViewBand.cs
- GridViewColumnCollection.cs
- _ShellExpression.cs
- MessageTraceRecord.cs
- OutputScopeManager.cs
- OrthographicCamera.cs
- TaiwanCalendar.cs
- X509ChainElement.cs
- SnapshotChangeTrackingStrategy.cs
- GenericEnumConverter.cs
- ValidationEventArgs.cs
- LeaseManager.cs
- DataGridViewTextBoxEditingControl.cs
- RtfControlWordInfo.cs
- RSAPKCS1SignatureDeformatter.cs
- TypeDescriptor.cs
- PlacementWorkspace.cs
- AccessDataSourceView.cs
- PlatformNotSupportedException.cs
- DecimalAnimationUsingKeyFrames.cs
- RuleInfoComparer.cs
- InfoCardBaseException.cs
- XmlArrayItemAttribute.cs
- Command.cs
- ExpressionConverter.cs
- DesignerActionHeaderItem.cs
- GridViewCancelEditEventArgs.cs
- ErrorFormatter.cs
- WindowsIdentity.cs
- ObjectViewQueryResultData.cs
- SessionIDManager.cs
- WebPartsSection.cs
- FormattedTextSymbols.cs
- SimpleType.cs
- ArrayWithOffset.cs
- CatalogPartCollection.cs
- StringToken.cs
- HandlerFactoryCache.cs
- ZipIOExtraFieldPaddingElement.cs
- Form.cs
- TemplateBaseAction.cs
- WindowsGraphics.cs
- base64Transforms.cs
- ModifierKeysValueSerializer.cs
- GroupStyle.cs
- CodeDomConfigurationHandler.cs
- TimeoutValidationAttribute.cs
- MD5.cs
- EntityParameterCollection.cs
- ListItemCollection.cs
- CustomAttributeFormatException.cs
- DbProviderFactoriesConfigurationHandler.cs
- JsonCollectionDataContract.cs
- ProtectedConfigurationProviderCollection.cs
- _ContextAwareResult.cs
- itemelement.cs
- EntitySet.cs
- ComponentEvent.cs
- MaterializeFromAtom.cs
- OleDbConnection.cs
- UrlMapping.cs
- WpfPayload.cs
- SystemException.cs
- PageParserFilter.cs
- ContentDisposition.cs
- AspNetHostingPermission.cs
- ZipIOFileItemStream.cs
- BaseDataList.cs
- ConnectionStringsSection.cs
- InplaceBitmapMetadataWriter.cs
- LogStream.cs
- SamlSecurityTokenAuthenticator.cs
- LambdaCompiler.Generated.cs
- GreenMethods.cs
- ConditionCollection.cs
- SetterBaseCollection.cs
- TextComposition.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- NoneExcludedImageIndexConverter.cs
- XmlIgnoreAttribute.cs
- LockCookie.cs