Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Runtime / InteropServices / COMException.cs / 1305376 / 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); } [System.Security.SecuritySafeCritical] // auto-generated protected COMException(SerializationInfo info, StreamingContext context) : base(info, context) { } [System.Security.SecuritySafeCritical] // auto-generated 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
- DiscoveryReference.cs
- ColumnTypeConverter.cs
- HighlightComponent.cs
- streamingZipPartStream.cs
- Point.cs
- PrintPreviewControl.cs
- ContentFilePart.cs
- RawStylusSystemGestureInputReport.cs
- EpmCustomContentWriterNodeData.cs
- DoubleAnimationUsingKeyFrames.cs
- Version.cs
- GenericAuthenticationEventArgs.cs
- X509RecipientCertificateClientElement.cs
- DocumentViewerHelper.cs
- FieldReference.cs
- ApplicationServicesHostFactory.cs
- TextTreeObjectNode.cs
- ParameterInfo.cs
- SharedStatics.cs
- TreeNodeStyle.cs
- DataColumnMappingCollection.cs
- AspProxy.cs
- PeerToPeerException.cs
- DefaultValueConverter.cs
- TimelineGroup.cs
- SymLanguageType.cs
- IntPtr.cs
- TextOnlyOutput.cs
- RequestStatusBarUpdateEventArgs.cs
- WebBaseEventKeyComparer.cs
- TypeUnloadedException.cs
- SqlAliasesReferenced.cs
- Path.cs
- PageThemeBuildProvider.cs
- MatrixAnimationBase.cs
- ADMembershipProvider.cs
- MailAddressCollection.cs
- RunClient.cs
- JsonServiceDocumentSerializer.cs
- WindowsGraphics.cs
- Blend.cs
- GenericWebPart.cs
- StringExpressionSet.cs
- odbcmetadatacollectionnames.cs
- _BaseOverlappedAsyncResult.cs
- ProviderUtil.cs
- ArcSegment.cs
- CatalogZone.cs
- _BufferOffsetSize.cs
- SettingsBase.cs
- MobileResource.cs
- PasswordBoxAutomationPeer.cs
- TableParagraph.cs
- ImageCollectionEditor.cs
- BaseConfigurationRecord.cs
- DesignBindingValueUIHandler.cs
- Interlocked.cs
- CssClassPropertyAttribute.cs
- MatrixTransform3D.cs
- CurrentChangingEventArgs.cs
- MaterialGroup.cs
- JsonEnumDataContract.cs
- ScrollChrome.cs
- PasswordTextNavigator.cs
- SQLMoneyStorage.cs
- DesignerDataConnection.cs
- NTAccount.cs
- RunInstallerAttribute.cs
- SID.cs
- CollectionChange.cs
- ValidationResults.cs
- CookieProtection.cs
- SystemTcpConnection.cs
- ValueSerializer.cs
- ParameterRetriever.cs
- OdbcReferenceCollection.cs
- RtType.cs
- TextSchema.cs
- TableLayout.cs
- WebBrowser.cs
- TextWriterTraceListener.cs
- ObjectNotFoundException.cs
- WindowsBrush.cs
- InternalsVisibleToAttribute.cs
- QueryableDataSourceEditData.cs
- X509ServiceCertificateAuthentication.cs
- PipelineModuleStepContainer.cs
- SqlComparer.cs
- ErrorRuntimeConfig.cs
- BackgroundFormatInfo.cs
- InheritablePropertyChangeInfo.cs
- ScaleTransform.cs
- DocumentViewerHelper.cs
- IWorkflowDebuggerService.cs
- GroupQuery.cs
- Exception.cs
- FontFamily.cs
- SqlDataSourceCommandEventArgs.cs
- Base64Encoder.cs
- ComponentEvent.cs