Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridPreparingCellForEditEventArgs.cs
- SqlDelegatedTransaction.cs
- ISAPIWorkerRequest.cs
- SqlFunctionAttribute.cs
- Variant.cs
- safelinkcollection.cs
- ValidationEventArgs.cs
- CodeGeneratorOptions.cs
- XslException.cs
- ProfileGroupSettings.cs
- COM2FontConverter.cs
- RequestNavigateEventArgs.cs
- x509store.cs
- LoginUtil.cs
- XmlSchema.cs
- CompilationUnit.cs
- RootProfilePropertySettingsCollection.cs
- SystemThemeKey.cs
- StorageComplexTypeMapping.cs
- OperationGenerator.cs
- SchemaAttDef.cs
- EntityContainer.cs
- XmlAttribute.cs
- SpecularMaterial.cs
- ECDiffieHellmanCng.cs
- DateTimeConstantAttribute.cs
- TimelineGroup.cs
- MultiPropertyDescriptorGridEntry.cs
- SchemaSetCompiler.cs
- DBSchemaTable.cs
- UnauthorizedWebPart.cs
- FileDataSourceCache.cs
- ObjectParameterCollection.cs
- AudioLevelUpdatedEventArgs.cs
- BoolLiteral.cs
- rsa.cs
- DelegatingConfigHost.cs
- Command.cs
- PersonalizableAttribute.cs
- SeekStoryboard.cs
- ParserContext.cs
- DataGridViewAccessibleObject.cs
- XmlJsonReader.cs
- PackageRelationshipCollection.cs
- Label.cs
- RoleGroupCollection.cs
- OdbcRowUpdatingEvent.cs
- WebBaseEventKeyComparer.cs
- VirtualizingPanel.cs
- DateTimeUtil.cs
- HtmlWindowCollection.cs
- XmlSerializerFactory.cs
- CfgArc.cs
- CompilerInfo.cs
- DrawingAttributes.cs
- Block.cs
- GeneralTransform.cs
- CompilerLocalReference.cs
- BrowserTree.cs
- COM2ColorConverter.cs
- QueryOutputWriter.cs
- XmlCharacterData.cs
- BinaryFormatter.cs
- PointUtil.cs
- DefaultHttpHandler.cs
- TabletDeviceInfo.cs
- GregorianCalendar.cs
- _ShellExpression.cs
- CodeCatchClause.cs
- XmlSigningNodeWriter.cs
- X509Utils.cs
- SvcMapFileLoader.cs
- BasicCellRelation.cs
- WebServiceEnumData.cs
- StrokeCollection.cs
- _TimerThread.cs
- FormViewPageEventArgs.cs
- IntMinMaxAggregationOperator.cs
- ListControl.cs
- OleDbParameter.cs
- StylusPointDescription.cs
- UInt64Converter.cs
- AssemblyBuilder.cs
- XmlUtilWriter.cs
- Processor.cs
- VersionedStreamOwner.cs
- ArrayItemReference.cs
- WorkBatch.cs
- Debug.cs
- Error.cs
- ImageListUtils.cs
- TimeSpanParse.cs
- Container.cs
- EditorZoneBase.cs
- PostBackTrigger.cs
- CatalogPart.cs
- ByteStream.cs
- GroupStyle.cs
- SourceCollection.cs
- StoreItemCollection.Loader.cs