Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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.
//
// ==--==
/*==============================================================================
**
** 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProcessHostMapPath.cs
- StringCollectionMarkupSerializer.cs
- IndentedWriter.cs
- XmlNodeReader.cs
- ConsoleKeyInfo.cs
- TraceLevelStore.cs
- SingleAnimationBase.cs
- ScrollItemPatternIdentifiers.cs
- CustomErrorsSection.cs
- SessionSwitchEventArgs.cs
- PerformanceCounterCategory.cs
- DefaultHttpHandler.cs
- DetailsViewRowCollection.cs
- CustomBinding.cs
- PointLightBase.cs
- Single.cs
- FixedElement.cs
- PageThemeParser.cs
- ConvertTextFrag.cs
- ITreeGenerator.cs
- Int64KeyFrameCollection.cs
- ErrorProvider.cs
- ToolBarOverflowPanel.cs
- RoleExceptions.cs
- QilDataSource.cs
- SiteMapHierarchicalDataSourceView.cs
- XmlWriterSettings.cs
- RoleProviderPrincipal.cs
- VirtualDirectoryMappingCollection.cs
- BufferedOutputStream.cs
- XpsFilter.cs
- DataGridViewCellStateChangedEventArgs.cs
- AssemblyGen.cs
- RemoteWebConfigurationHostStream.cs
- CollectionChangeEventArgs.cs
- DebugView.cs
- xml.cs
- COM2TypeInfoProcessor.cs
- DataColumnChangeEvent.cs
- FileVersionInfo.cs
- TextWriterTraceListener.cs
- BeginEvent.cs
- Certificate.cs
- BorderGapMaskConverter.cs
- SqlClientWrapperSmiStream.cs
- BuildDependencySet.cs
- AssemblyCollection.cs
- SoapInteropTypes.cs
- DecoratedNameAttribute.cs
- ExpressionNode.cs
- AngleUtil.cs
- HttpBrowserCapabilitiesBase.cs
- ValueTable.cs
- UndoManager.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- FontDifferentiator.cs
- KeyFrames.cs
- IgnoreSection.cs
- ToolBarTray.cs
- PermissionSetTriple.cs
- InternalCache.cs
- Clause.cs
- MsmqHostedTransportManager.cs
- TableLayoutStyle.cs
- RequiredFieldValidator.cs
- _DomainName.cs
- DocumentXPathNavigator.cs
- Pointer.cs
- WindowsIdentity.cs
- XmlComplianceUtil.cs
- PageRequestManager.cs
- StreamUpdate.cs
- XamlPointCollectionSerializer.cs
- BaseProcessProtocolHandler.cs
- SerializableAuthorizationContext.cs
- PersistenceTypeAttribute.cs
- GlyphCache.cs
- SyndicationElementExtension.cs
- MenuAdapter.cs
- HierarchicalDataSourceControl.cs
- Stopwatch.cs
- ExceptionValidationRule.cs
- OleDbMetaDataFactory.cs
- AxisAngleRotation3D.cs
- Stacktrace.cs
- VBIdentifierNameEditor.cs
- XmlChildEnumerator.cs
- SizeConverter.cs
- SQLDecimal.cs
- Bits.cs
- RotationValidation.cs
- xmlformatgeneratorstatics.cs
- GeometryModel3D.cs
- SQLInt16.cs
- WebHttpElement.cs
- UnhandledExceptionEventArgs.cs
- DataGridViewUtilities.cs
- HttpListenerRequestUriBuilder.cs
- SqlNodeAnnotations.cs
- MimeMapping.cs