Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WindowsEditBoxRange.cs
- Models.cs
- Exceptions.cs
- DataKey.cs
- FunctionDetailsReader.cs
- OdbcConnectionString.cs
- PasswordRecovery.cs
- CompositeControl.cs
- TrustLevelCollection.cs
- CommonRemoteMemoryBlock.cs
- GetIndexBinder.cs
- MatrixTransform.cs
- ProcessManager.cs
- IsolatedStorageException.cs
- ReceiveSecurityHeader.cs
- VisualStyleRenderer.cs
- Enum.cs
- TreeView.cs
- ping.cs
- PeerContact.cs
- HttpProfileGroupBase.cs
- ConstrainedDataObject.cs
- DataGridCell.cs
- DefaultObjectSerializer.cs
- MetadataSerializer.cs
- HttpResponseBase.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- ResourceExpressionBuilder.cs
- IList.cs
- ClientFormsIdentity.cs
- SamlSubject.cs
- OdbcEnvironmentHandle.cs
- KeyManager.cs
- EventLog.cs
- ContainerCodeDomSerializer.cs
- SystemTcpStatistics.cs
- RenderDataDrawingContext.cs
- XmlFormatExtensionAttribute.cs
- OleDbConnectionFactory.cs
- GlyphManager.cs
- InstanceDataCollectionCollection.cs
- PartitionerStatic.cs
- SQLDateTimeStorage.cs
- CanonicalFontFamilyReference.cs
- KeyManager.cs
- SmiRequestExecutor.cs
- OptionalMessageQuery.cs
- AlphabeticalEnumConverter.cs
- GAC.cs
- DesignTimeType.cs
- WebPartActionVerb.cs
- DesignerLoader.cs
- AppSecurityManager.cs
- _NestedMultipleAsyncResult.cs
- WindowsToolbarAsMenu.cs
- UriWriter.cs
- HwndTarget.cs
- AccessViolationException.cs
- CompilationSection.cs
- dbenumerator.cs
- XmlSchemaObjectCollection.cs
- ConstraintCollection.cs
- ProjectionAnalyzer.cs
- PrintPreviewDialog.cs
- StaticResourceExtension.cs
- FixedTextBuilder.cs
- datacache.cs
- AuthenticationService.cs
- ObjectHelper.cs
- HtmlUtf8RawTextWriter.cs
- MainMenu.cs
- CancellableEnumerable.cs
- Codec.cs
- InlineUIContainer.cs
- CodeGenerator.cs
- SrgsText.cs
- sitestring.cs
- HealthMonitoringSection.cs
- ConfigXmlAttribute.cs
- ArraySegment.cs
- _ListenerRequestStream.cs
- ActiveXContainer.cs
- PropertyDescriptorComparer.cs
- DisplayClaim.cs
- BindValidator.cs
- KeyNotFoundException.cs
- KeyInstance.cs
- XmlSchemaObjectTable.cs
- CheckBox.cs
- XLinq.cs
- ReadOnlyNameValueCollection.cs
- ConnectionManagementElement.cs
- GroupItemAutomationPeer.cs
- ClaimTypes.cs
- CopyCodeAction.cs
- MetadataCache.cs
- XPathChildIterator.cs
- XsltLibrary.cs
- DataGridViewRowConverter.cs
- DataRelation.cs