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
- PermissionListSet.cs
- ValueQuery.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- HwndAppCommandInputProvider.cs
- DoubleAnimationUsingPath.cs
- MimeWriter.cs
- XmlBinaryWriterSession.cs
- PhonemeEventArgs.cs
- ServicePointManagerElement.cs
- SqlExpander.cs
- DataViewListener.cs
- TextLineBreak.cs
- TreeBuilderXamlTranslator.cs
- DataGridViewTextBoxColumn.cs
- FieldBuilder.cs
- NextPreviousPagerField.cs
- Point.cs
- SemanticAnalyzer.cs
- SystemInfo.cs
- SafeNativeMethods.cs
- dataSvcMapFileLoader.cs
- SQLGuidStorage.cs
- CompilerError.cs
- CmsInterop.cs
- CustomWebEventKey.cs
- TypeGeneratedEventArgs.cs
- Scene3D.cs
- SvcMapFile.cs
- DataGridViewRowConverter.cs
- BaseCollection.cs
- CompiledQuery.cs
- WindowsAuthenticationModule.cs
- ComponentRenameEvent.cs
- SecurityManager.cs
- QueryRewriter.cs
- MetafileHeaderWmf.cs
- RegexInterpreter.cs
- ComponentFactoryHelpers.cs
- DtdParser.cs
- NestPullup.cs
- DesignTableCollection.cs
- BitmapSourceSafeMILHandle.cs
- ResolveNameEventArgs.cs
- CodeParameterDeclarationExpression.cs
- JoinSymbol.cs
- SemaphoreSecurity.cs
- ContractListAdapter.cs
- CqlQuery.cs
- SkinBuilder.cs
- RijndaelManaged.cs
- ComPlusContractBehavior.cs
- ConstructorNeedsTagAttribute.cs
- QilPatternFactory.cs
- MethodImplAttribute.cs
- BaseTemplateParser.cs
- PolyLineSegmentFigureLogic.cs
- VerificationException.cs
- SqlHelper.cs
- FigureHelper.cs
- HtmlTableRowCollection.cs
- DataMisalignedException.cs
- SQLDateTimeStorage.cs
- HttpWrapper.cs
- BlurEffect.cs
- ComplexObject.cs
- Vector.cs
- MeasureData.cs
- ProfileService.cs
- ComplusEndpointConfigContainer.cs
- ProfileManager.cs
- CompiledRegexRunner.cs
- CommandBindingCollection.cs
- ThreadPool.cs
- TdsParserSessionPool.cs
- MeshGeometry3D.cs
- WebPartRestoreVerb.cs
- HtmlInputSubmit.cs
- FrameAutomationPeer.cs
- RawStylusSystemGestureInputReport.cs
- BulletDecorator.cs
- FlagsAttribute.cs
- XmlSchemaObjectTable.cs
- FontSourceCollection.cs
- DataSourceBooleanViewSchemaConverter.cs
- ObjectReaderCompiler.cs
- ListViewDeletedEventArgs.cs
- BooleanFunctions.cs
- XamlReaderHelper.cs
- CaseInsensitiveHashCodeProvider.cs
- CopyOfAction.cs
- VerificationAttribute.cs
- DataGridItem.cs
- CompensatableSequenceActivity.cs
- CodeIdentifiers.cs
- KnownBoxes.cs
- RootDesignerSerializerAttribute.cs
- TemplateControlBuildProvider.cs
- DataGridTablesFactory.cs
- BaseHashHelper.cs
- CodeNamespaceImportCollection.cs