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
- DelegatingChannelListener.cs
- cookieexception.cs
- CollectionTypeElement.cs
- Simplifier.cs
- DecimalConstantAttribute.cs
- WebCategoryAttribute.cs
- StringUtil.cs
- shaperfactory.cs
- RootDesignerSerializerAttribute.cs
- PrtCap_Base.cs
- RadioButtonRenderer.cs
- SchemeSettingElementCollection.cs
- HotSpot.cs
- RoleGroup.cs
- OpenTypeLayoutCache.cs
- DataSourceControlBuilder.cs
- WindowsIPAddress.cs
- Model3DCollection.cs
- SyndicationFeedFormatter.cs
- IntegerValidatorAttribute.cs
- HiddenField.cs
- SqlMethods.cs
- InkCanvasSelectionAdorner.cs
- DependencyProperty.cs
- SqlXmlStorage.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- DbConvert.cs
- RegionInfo.cs
- HtmlWindow.cs
- HtmlCalendarAdapter.cs
- SessionStateItemCollection.cs
- ComboBox.cs
- WindowCollection.cs
- ListBox.cs
- ProviderCollection.cs
- BamlLocalizabilityResolver.cs
- DataRow.cs
- BamlResourceSerializer.cs
- PaintEvent.cs
- XmlTextReaderImplHelpers.cs
- Type.cs
- GeneratedCodeAttribute.cs
- GridSplitter.cs
- NotificationContext.cs
- VisualTreeHelper.cs
- FlowNode.cs
- diagnosticsswitches.cs
- HelpProvider.cs
- WeakReferenceKey.cs
- SmiEventSink_DeferedProcessing.cs
- TreeViewImageKeyConverter.cs
- MemberDomainMap.cs
- ViewgenGatekeeper.cs
- Transactions.cs
- LogLogRecordHeader.cs
- DataGridViewRowContextMenuStripNeededEventArgs.cs
- InvalidCommandTreeException.cs
- CopyOnWriteList.cs
- DataSourceControl.cs
- CachedTypeface.cs
- File.cs
- QilFunction.cs
- IndentTextWriter.cs
- InternalResources.cs
- ExtentJoinTreeNode.cs
- RealizationContext.cs
- XmlSchemaParticle.cs
- ObjectSecurity.cs
- ProtectedConfigurationSection.cs
- DynamicPropertyHolder.cs
- MenuItem.cs
- ExpanderAutomationPeer.cs
- ConditionValidator.cs
- AssemblyBuilderData.cs
- SystemWebCachingSectionGroup.cs
- DbProviderFactoriesConfigurationHandler.cs
- DependencyPropertyKind.cs
- MimeXmlReflector.cs
- SchemaCollectionPreprocessor.cs
- ProbeMatchesMessage11.cs
- DictionaryManager.cs
- SchemaImporterExtension.cs
- EndpointConfigContainer.cs
- ImplicitInputBrush.cs
- XPathNode.cs
- FontResourceCache.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- EventLogger.cs
- SqlDataSourceView.cs
- WebDescriptionAttribute.cs
- TableLayout.cs
- SqlDataSourceSelectingEventArgs.cs
- TextElementEnumerator.cs
- LinqDataSourceContextEventArgs.cs
- DelimitedListTraceListener.cs
- BulletChrome.cs
- ConnectionStringsSection.cs
- DesignerAdapterAttribute.cs
- remotingproxy.cs