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
- XmlSchemaImporter.cs
- ISFClipboardData.cs
- DocumentOrderQuery.cs
- XmlHierarchicalDataSourceView.cs
- BaseParaClient.cs
- ToolboxCategory.cs
- DispatcherSynchronizationContext.cs
- CompoundFileIOPermission.cs
- WorkflowPersistenceService.cs
- TrustManager.cs
- ToolStripItemRenderEventArgs.cs
- InteropAutomationProvider.cs
- CacheEntry.cs
- CngKey.cs
- TableItemProviderWrapper.cs
- ThreadInterruptedException.cs
- TranslateTransform3D.cs
- ResolveMatchesApril2005.cs
- LogicalCallContext.cs
- BamlTreeMap.cs
- HTMLTextWriter.cs
- PriorityQueue.cs
- TableLayout.cs
- ClientApiGenerator.cs
- StringOutput.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- ReceiveContent.cs
- EntityDataSourceDesigner.cs
- DefaultValueConverter.cs
- PauseStoryboard.cs
- TableLayoutStyleCollection.cs
- WCFServiceClientProxyGenerator.cs
- RepeaterCommandEventArgs.cs
- XmlSerializer.cs
- CustomError.cs
- ExceptionWrapper.cs
- Journaling.cs
- RowToFieldTransformer.cs
- ArgumentException.cs
- AssemblyCollection.cs
- SchemaTypeEmitter.cs
- WindowInteractionStateTracker.cs
- MultipleViewProviderWrapper.cs
- COM2IPerPropertyBrowsingHandler.cs
- SQLSingleStorage.cs
- ConstantCheck.cs
- ToolStripSplitStackLayout.cs
- ApplicationFileCodeDomTreeGenerator.cs
- WindowsListViewScroll.cs
- SessionStateContainer.cs
- DbException.cs
- SizeChangedInfo.cs
- TemplateControl.cs
- PrintController.cs
- PeerNeighborManager.cs
- PngBitmapEncoder.cs
- EventlogProvider.cs
- ReachPageContentSerializer.cs
- Cursor.cs
- Timeline.cs
- WebPartConnectionsCancelEventArgs.cs
- StorageScalarPropertyMapping.cs
- FontUnit.cs
- Storyboard.cs
- HttpListenerContext.cs
- Line.cs
- QuestionEventArgs.cs
- DataFormat.cs
- SecurityKeyIdentifierClause.cs
- XamlPathDataSerializer.cs
- templategroup.cs
- ToolBarTray.cs
- BatchStream.cs
- FixedTextContainer.cs
- CodeAccessSecurityEngine.cs
- TreeViewImageGenerator.cs
- Configuration.cs
- ControlAdapter.cs
- RoutedEventValueSerializer.cs
- Header.cs
- GenericIdentity.cs
- ByteAnimationBase.cs
- Int64Animation.cs
- BamlMapTable.cs
- CodeDomSerializerException.cs
- ToolStripDropDown.cs
- MostlySingletonList.cs
- SqlFacetAttribute.cs
- ReadOnlyCollectionBase.cs
- RightsManagementSuppressedStream.cs
- XPathNode.cs
- DataControlFieldTypeEditor.cs
- ClientBuildManagerCallback.cs
- WindowsTooltip.cs
- AssemblyFilter.cs
- SamlAuthorityBinding.cs
- PropertyInformationCollection.cs
- TableRowsCollectionEditor.cs
- SplayTreeNode.cs
- GridToolTip.cs