Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Runtime / InteropServices / ErrorWrapper.cs / 1 / ErrorWrapper.cs
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
/*==============================================================================
**
** Class: ErrorWrapper.
**
**
** Purpose: Wrapper that is converted to a variant with VT_ERROR.
**
**
=============================================================================*/
namespace System.Runtime.InteropServices {
using System;
using System.Security.Permissions;
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ErrorWrapper
{
public ErrorWrapper(int errorCode)
{
m_ErrorCode = errorCode;
}
public ErrorWrapper(Object errorCode)
{
if (!(errorCode is int))
throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32"), "errorCode");
m_ErrorCode = (int)errorCode;
}
[SecurityPermissionAttribute(SecurityAction.Demand, Flags=SecurityPermissionFlag.UnmanagedCode)]
public ErrorWrapper(Exception e)
{
m_ErrorCode = Marshal.GetHRForException(e);
}
public int ErrorCode
{
get
{
return m_ErrorCode;
}
}
private int m_ErrorCode;
}
}
// 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
- HtmlGenericControl.cs
- DataSvcMapFile.cs
- DocumentSequence.cs
- SegmentInfo.cs
- PrintDialogException.cs
- ConfigXmlReader.cs
- MetadataSerializer.cs
- CodeDomSerializerException.cs
- ViewPort3D.cs
- Attributes.cs
- InheritanceAttribute.cs
- InputLanguageCollection.cs
- SmiSettersStream.cs
- IndexedEnumerable.cs
- SqlMethodCallConverter.cs
- TaskFactory.cs
- SqlRowUpdatedEvent.cs
- SimpleTypeResolver.cs
- _CookieModule.cs
- TransformedBitmap.cs
- WebHeaderCollection.cs
- XmlMembersMapping.cs
- HotSpot.cs
- ReachFixedDocumentSerializerAsync.cs
- ServiceThrottle.cs
- unsafeIndexingFilterStream.cs
- DateBoldEvent.cs
- SQLStringStorage.cs
- WebMessageEncoderFactory.cs
- ExtendedPropertiesHandler.cs
- Point3DValueSerializer.cs
- GenericWebPart.cs
- ListViewDeletedEventArgs.cs
- LoginName.cs
- Trace.cs
- XmlByteStreamWriter.cs
- Matrix3D.cs
- WSFederationHttpBindingElement.cs
- Rule.cs
- CancelEventArgs.cs
- PEFileReader.cs
- SectionRecord.cs
- TextElementAutomationPeer.cs
- TableCell.cs
- MissingMemberException.cs
- TransactionTable.cs
- RawUIStateInputReport.cs
- DataGridCellsPanel.cs
- safePerfProviderHandle.cs
- MimePart.cs
- LayoutSettings.cs
- ValidatorCompatibilityHelper.cs
- LoadWorkflowAsyncResult.cs
- Switch.cs
- HashHelper.cs
- TextUtf8RawTextWriter.cs
- ExtensionSimplifierMarkupObject.cs
- coordinator.cs
- DocumentSequenceHighlightLayer.cs
- InfoCardCryptoHelper.cs
- ParseChildrenAsPropertiesAttribute.cs
- RSAPKCS1SignatureDeformatter.cs
- TransactionScope.cs
- Brushes.cs
- ReceiveMessageAndVerifySecurityAsyncResultBase.cs
- LockedBorderGlyph.cs
- MailMessageEventArgs.cs
- FileDataSourceCache.cs
- DataGridViewMethods.cs
- COM2ExtendedBrowsingHandler.cs
- PointConverter.cs
- AsyncResult.cs
- CallInfo.cs
- XmlAnyAttributeAttribute.cs
- DrawingCollection.cs
- ValidationErrorInfo.cs
- CrossContextChannel.cs
- ResourceContainer.cs
- TextMarkerSource.cs
- ControlEvent.cs
- NamedPipeConnectionPool.cs
- DataGridViewCellEventArgs.cs
- FormsAuthenticationEventArgs.cs
- SafeReversePInvokeHandle.cs
- CacheAxisQuery.cs
- PathParser.cs
- CodePropertyReferenceExpression.cs
- CriticalHandle.cs
- DoubleLinkListEnumerator.cs
- ResourcePermissionBase.cs
- CombinedGeometry.cs
- Preprocessor.cs
- AnimationLayer.cs
- TableChangeProcessor.cs
- Font.cs
- XmlImplementation.cs
- CommandEventArgs.cs
- HiddenFieldPageStatePersister.cs
- ProcessThreadCollection.cs
- CounterSample.cs