Code:
/ DotNET / DotNET / 8.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
- _Connection.cs
- DataContractSerializer.cs
- BoolExpression.cs
- ProfileManager.cs
- StickyNote.cs
- GlobalItem.cs
- DesignerWithHeader.cs
- AttributeParameterInfo.cs
- TypeGeneratedEventArgs.cs
- AdvancedBindingEditor.cs
- WSTransactionSection.cs
- ProxyWebPartManager.cs
- MethodCallConverter.cs
- DataGridViewRowHeaderCell.cs
- Vector3DConverter.cs
- SystemGatewayIPAddressInformation.cs
- XmlSchemaImport.cs
- URLEditor.cs
- InputScope.cs
- ErrorTableItemStyle.cs
- XmlAttributeCollection.cs
- TextDecorationCollection.cs
- WebBrowserNavigatingEventHandler.cs
- OleDbWrapper.cs
- ConfigXmlSignificantWhitespace.cs
- DesignerView.cs
- MasterPageBuildProvider.cs
- SystemIPInterfaceStatistics.cs
- CannotUnloadAppDomainException.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- CodeStatement.cs
- DataSpaceManager.cs
- QuaternionAnimationUsingKeyFrames.cs
- RoleManagerSection.cs
- CodeCompiler.cs
- TimeStampChecker.cs
- SqlStatistics.cs
- CaseExpr.cs
- EmptyElement.cs
- WebRequestModuleElement.cs
- PagedDataSource.cs
- AuthenticationSection.cs
- TextAnchor.cs
- PostBackTrigger.cs
- MDIWindowDialog.cs
- GeneralTransformGroup.cs
- DecimalAverageAggregationOperator.cs
- ProfileModule.cs
- LinearKeyFrames.cs
- RtfNavigator.cs
- ToolStripStatusLabel.cs
- HttpPostedFileBase.cs
- FrameworkElementFactoryMarkupObject.cs
- LambdaCompiler.Expressions.cs
- XmlReader.cs
- MenuItem.cs
- CipherData.cs
- AQNBuilder.cs
- AttachedPropertiesService.cs
- Style.cs
- ThreadPool.cs
- DynamicValidator.cs
- FormsAuthenticationModule.cs
- AppSettingsExpressionBuilder.cs
- MarkupProperty.cs
- ScriptDescriptor.cs
- EUCJPEncoding.cs
- RectKeyFrameCollection.cs
- XmlSchemaAttributeGroup.cs
- BeginStoryboard.cs
- DXD.cs
- TreeViewImageKeyConverter.cs
- SchemaTableColumn.cs
- ServiceContractGenerator.cs
- XslTransform.cs
- EventMappingSettings.cs
- SetStateDesigner.cs
- ContentOperations.cs
- CorePropertiesFilter.cs
- LinkButton.cs
- DataGridBoolColumn.cs
- LoginName.cs
- TreeViewDesigner.cs
- Graphics.cs
- DeflateStreamAsyncResult.cs
- UrlPath.cs
- DataGridTable.cs
- CellRelation.cs
- XmlDataDocument.cs
- DataPagerField.cs
- ClientBuildManagerCallback.cs
- Rules.cs
- NameValueFileSectionHandler.cs
- httpstaticobjectscollection.cs
- Rect.cs
- ReferencedCollectionType.cs
- CommandEventArgs.cs
- SqlDataSourceStatusEventArgs.cs
- BindingBase.cs
- PersonalizationStateQuery.cs