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
- PaginationProgressEventArgs.cs
- DefaultAssemblyResolver.cs
- ImageDrawing.cs
- OdbcCommand.cs
- BamlRecordReader.cs
- DataPager.cs
- OperationResponse.cs
- StandardToolWindows.cs
- MasterPageCodeDomTreeGenerator.cs
- MobileControlBuilder.cs
- AnchorEditor.cs
- ProbeDuplex11AsyncResult.cs
- TreeViewBindingsEditor.cs
- MenuAutomationPeer.cs
- TypeLibConverter.cs
- XmlNamespaceManager.cs
- Compiler.cs
- DataGridViewComboBoxColumn.cs
- SoundPlayer.cs
- autovalidator.cs
- filewebresponse.cs
- rsa.cs
- WebPartConnectionsCloseVerb.cs
- Buffer.cs
- TypeUnloadedException.cs
- Message.cs
- SafeReversePInvokeHandle.cs
- XmlObjectSerializerWriteContext.cs
- SqlError.cs
- GridViewUpdatedEventArgs.cs
- UnknownWrapper.cs
- DataGridViewSelectedCellCollection.cs
- TabRenderer.cs
- WebServiceMethodData.cs
- Vector3D.cs
- Vector3DConverter.cs
- PropertyTabChangedEvent.cs
- MD5.cs
- _Events.cs
- ImageField.cs
- SecurityRuntime.cs
- TypeUtil.cs
- MachinePropertyVariants.cs
- RowBinding.cs
- MeasureItemEvent.cs
- ApplicationHost.cs
- EqualityArray.cs
- HandlerWithFactory.cs
- XPathSingletonIterator.cs
- TaskExceptionHolder.cs
- FormClosingEvent.cs
- BrushConverter.cs
- GPRECTF.cs
- FontConverter.cs
- UnionCqlBlock.cs
- DBAsyncResult.cs
- UniqueConstraint.cs
- LinkedDataMemberFieldEditor.cs
- ScriptControl.cs
- UrlMappingsSection.cs
- ParallelTimeline.cs
- Validator.cs
- HostingEnvironmentSection.cs
- MessageQueueAccessControlEntry.cs
- ActivityDesignerAccessibleObject.cs
- MultiSelector.cs
- DataDocumentXPathNavigator.cs
- CodeRegionDirective.cs
- CharStorage.cs
- SourceItem.cs
- ProcessExitedException.cs
- TextEditorLists.cs
- X509Extension.cs
- LayoutSettings.cs
- ViewManager.cs
- assertwrapper.cs
- JoinGraph.cs
- EventListenerClientSide.cs
- SupportsPreviewControlAttribute.cs
- NameValueCache.cs
- QuaternionIndependentAnimationStorage.cs
- MatrixAnimationUsingKeyFrames.cs
- FrugalMap.cs
- PriorityChain.cs
- RankException.cs
- DataBoundControlAdapter.cs
- HttpTransportSecurity.cs
- ErrorFormatter.cs
- MemberDomainMap.cs
- CustomAttributeSerializer.cs
- SqlTypeSystemProvider.cs
- WinFormsComponentEditor.cs
- XmlSchemaSubstitutionGroup.cs
- ProgressiveCrcCalculatingStream.cs
- ReadOnlyHierarchicalDataSource.cs
- FixedDocument.cs
- IntSumAggregationOperator.cs
- UIElement.cs
- ViewUtilities.cs
- ResourceExpressionEditor.cs